将 TTS 功能添加到 Dart 控制台应用程序
我可以获得一些有关如何将文本转语音功能添加到控制台/CLI 应用程序的指示吗?我尝试过 Flutter 包,但收到此错误“错误:未找到:'dart:ui'”。我假设他们期望有一个用户界面。
我几乎是一个新手,很高兴答案不要在我这边假设太多。谢谢!
can I get some pointers on how to add Text To Speech functionality to a console/CLI app. I have tried packages for Flutter but I get this error 'Error: Not found: 'dart:ui'. I am assuming they expect a user interface.
I am pretty much a novice, would be glad answers do not assume too much on my side. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,Flutter 是关于 UI 的,而命令行应用程序没有 UI。
除了 Dart 是 Flutter 使用的语言之外,它们彼此没有任何关系。
Flutter tts 插件取决于插件将运行的操作系统中嵌入的特定 tts 实现 - Android / IOS 等。Dart
命令行工具在虚拟机中运行,并且与操作系统无关。
因此,据我所知,不可能将 Flutter 插件导入到 Dart 命令行应用程序中然后进行编译。
我能看到在 Dart 命令行工具中获取 tts 功能的唯一方法是使用基于 Web(独立于操作系统)的 tts 服务,例如 Google 文本转语音API。
Yes, Flutter is all about UI whereas a command line app has no UI.
They dont have anything to do with eachother except that Dart is the language used by Flutter.
Flutter tts plugins depend on the specific tts implementation embedded in the OS that the plugin will be running on — Android / IOS, etc.
A Dart command line tool runs in a VM and is OS-independent.
So, as far as I know, it is impossible to import a Flutter plugin into a Dart command line app and then compile it.
The only way I can see to get tts functionality in a Dart command line tool is to use a web based (OS-independent) tts service such as the Google text to speech API.