简体   繁体   English

调高音量和调低音量,通过本地应用在Google TV上静音

[英]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.

相关问题 如何从android传输红外线以打开电视电源,提高音量和降低音量 - How to transmit infrared from android for tv power on, volume up and down 通过移动设备的音量调低按钮调整Chromecast电视的音量 - Adjusting chromecast tv volume through mobile device volume up down buttons 如何静音 Google IMA 广告的音量 - How to mute volume of Google IMA Ads 如何在Android Studio中接收IncomingCall时单击电源按钮或音量调高或静音时静音 - How to mute ringtone while clicking power button or volume up or down when i receiving IncomingCall in Android Studio 按下,调高或调低应用程式时当机 - App crash when press back , volume up or down Android VideoView:如何在应用程序中接收音量增大/减小指示 - Android VideoView: How to receive volume up/down indications in the app 如何在按下音量增大或音量减小按钮时启动Android应用程序? - How can I launch an android app on upon pressing the volume up or volume down button? 只需单击一下降低音量的Boton,即可关闭Android MediaPlayer - Android MediaPlayer to mute on a single click on Volume down botton pressed 当我从蓝牙耳机向上/向下推音量时,如何获得音量键码值 - How to get volume keycode value when I push volume up / down from Bluetooth headset SimpleAudioEngine,在PlayEffect上降低背景音量,然后再进行备份 - SimpleAudioEngine, background Volume down on playEffect then back up
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM