[英]Volume UP and Volume Down, Mute on Google TV from Local App
Application: a UPNP media server runing on Google TV. 应用程序:在Google TV上运行的UPNP媒体服务器。 I'd like to raise and lower the volume of the TV and/or amplifier (as configured by the user in system settings).
我想提高和降低电视和/或放大器的音量(由用户在系统设置中配置)。
AudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, ...) does pretty much nothing when the user has configured the Google TV device to use volume control on the TV or Amplifier. 当用户已将Google TV设备配置为在电视或放大器上使用音量控制时,AudioManager.setStreamVolume(AudioManager.STREAM_MUSIC,...)几乎没有任何作用。
Is there a way to simulate the effect of the Volume Up, Down and Mute keys on a Google TV remote, from software? 有没有一种方法可以通过软件模拟音量调高,调低和静音键在Google TV遥控器上的效果?
I know it can be done with the Anymote protocol. 我知道可以使用Anymote协议来完成。 But that requires pairing, even when the UPNP media server is running locally.
但是,即使UPNP媒体服务器在本地运行,也需要配对。 Not happening.
没有发生。
The functionality runs in a service that potentially has no active UI, so dispatching a KeyEvent isn't an option either, I don't think. 该功能在可能没有活动UI的服务中运行,所以我也不认为调度KeyEvent也不是一种选择。
The new Google TVs (NSZ, Vizio and LG) are ARM based. 新的Google TV(NSZ,Vizio和LG)基于ARM。 As to the question about volume control - because the volume control has been handed over to an external system you would need to listen in on changes to the other device as well the application would need to know what the active audio stream was.
关于音量控制的问题-由于音量控制已移交给外部系统,因此您还需要侦听其他设备的更改,应用程序也需要知道活动音频流是什么。 From the limited code snippet above it looks like you are trying to set the volume on STREAM_MUSIC have you tried STREAM_SYSTEM?
从上面的受限代码段中,您似乎正在尝试在STREAM_MUSIC上设置音量,是否尝试过STREAM_SYSTEM?
Another thought I had was that you could run a version of an Anymote client in your application as a service (the remote would run on the tv - kinda strange but could work) and your app could then call the service to trigger the volume change since you indicated it works with Anymote. 我的另一种想法是,您可以在应用程序中将Anymote客户端的版本作为服务运行(遥控器将在电视上运行-有点奇怪,但可以工作),然后您的应用程序可以调用该服务以触发音量更改,因为您表示它适用于Anymote。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.