Android的TTS音量控制 [英] Android TTS volume control
问题描述
有没有办法发送请求到TTS引擎时控制TTS引擎的音量?可我能使用AudioManager这里?
Is there any way to control volume of TTS engine when sending request to TTS engine? Can I able to use AudioManager here?
感谢你。
推荐答案
是的,你的问题问,你能使用的 AudioManager 的TTS声音。
Yes, as your question asks, you are able to use AudioManager for TTS audio.
如果你想在你的code设置音量,你要使用 getStreamVolume()
和 setStreamVolume()
的方法。
If you want to set volume in your code, you'll want to use the getStreamVolume()
and setStreamVolume()
methods.
如果你想给在该卷的用户控件(这可能取决于如何/当你的程序设置音量),这个问题指出,你必须叫 setVolumeControlStream()
在的OnCreate()
。
If you want to give the user control over the volume (this may depend on how/when your program sets volume), this question points out that you have to call setVolumeControlStream()
during OnCreate()
.
编辑:并没有,你无法控制TTS引擎的的方法(即在线()
法)。
And no, you cannot control volume within the TTS engine's methods (i.e. the Speak()
method).
这篇关于Android的TTS音量控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!