Android AVD 启动时控制台中显示“模拟器:警告:打开音频输入失败”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11682829/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 08:27:28  来源:igfitidea点击:

"emulator: warning: opening audio input failed" displayed in the console while AVD is launching

androidandroid-emulatoravd

提问by user1556811

"emulator: warning: opening audio input failed"

The above message is displayed in the consoleeverytime an AVD is launching, and then no soundis coming out from the emulator.

每次启动 AVD 时控制台中都会显示上述消息,然后模拟器就没有声音了。

I have tried to delete the AVDand have created a new one again and again, but it didn't help with the problem.

我试图删除 AVD并一次又一次地创建一个新的,但这对问题没有帮助。

I have also searched on Google for many time, but I find nothing useful.

我也在谷歌上搜索了很多次,但没有发现任何有用的东西。

It is really interesting that people tend to suggest to just ignore the problem because the AVD is still working fine without sound.

有趣的是,人们倾向于建议忽略这个问题,因为 AVD 在没有声音的情况下仍然可以正常工作。

But I am writing an Android App that related to sound, I really need a workable solution to make the AVD to "speak" again.

但是我正在编写一个与声音相关的 Android 应用程序,我真的需要一个可行的解决方案来让AVD 再次“说话”

Many thanks to you.

非常感谢你。

回答by Anybug

you can disable audio input setting manually : go to your-avd-path/config.inithen change the line hw.audioInput=yesto hw.audioInput=no

您可以手动禁用音频输入设置:转到your-avd-path/config.ini然后将行更改hw.audioInput=yeshw.audioInput=no

回答by Renjith

Open the AVD Manager.Click edit on any existing Virtual Device created or create a new one. On the create Virtual device Window, there is a newbutton on hardware tab.When that button is clicked, u will get a number of properties. Select the necessary property (like Audio Playback Support). I think that will do the trick.

打开 AVD 管理器。在创建的任何现有虚拟设备上单击编辑或创建一个新虚拟设备。在创建虚拟设备窗口中,硬件选项卡上有一个按钮。单击该按钮后,您将获得许多属性。选择必要的属性(如Audio Playback Support)。我认为这会奏效。

EDIT: This was possible in earlier versions of AVD Manager. Android updated the AVD to a new one(that we see now). There is no option to enable/disable audio/video in the new AVD creation window and there is no word of it in the AVD documentation.

编辑:这在AVD 管理器的早期版本中是可能的。Android 将 AVD 更新为一个新的(我们现在看到的)。在新的 AVD 创建窗口中没有启用/禁用音频/视频的选项,并且在AVD 文档中也没有相关说明

However they specify that you can play audio and video using Emulator.

但是他们指定您可以使用模拟器播放音频和视频。

AVDs let you define certain hardware aspects of your emulated phone and allow you to create many configurations to test many Android platforms and hardware permutations. Once your application is running on the emulator, it can use the services of the Android platform to invoke other applications, access the network, play audio and video, store and retrieve data, notify the user, and render graphical transitions and themes.

AVD 允许您定义模拟手机的某些硬件方面,并允许您创建许多配置来测试许多 Android 平台和硬件排列。一旦您的应用程序在模拟器上运行,它就可以使用 Android 平台的服务来调用其他应用程序、访问网络、播放音频和视频、存储和检索数据、通知用户以及呈现图形转换和主题。

回答by Fanny Darmer

The way I solved my issue: Make sure you do not have anything else "using" or diverting your audio driver.

我解决问题的方式:确保您没有其他任何东西“使用”或转移您的音频驱动程序。

In my instance I also work with audio devices for music applications. This one in particular was "Hyman Audio". So I disabled the Hyman Audio server and my audio device came back.

在我的例子中,我还使用用于音乐应用程序的音频设备。这个特别是“Hyman Audio”。所以我禁用了 Hyman Audio 服务器,我的音频设备又回来了。