使用麦克风在Android模拟器(Java的+ Android的初学者) [英] Using microphone in android emulator (Java + Android beginner)

查看:417
本文介绍了使用麦克风在Android模拟器(Java的+ Android的初学者)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<一个href="http://stackoverflow.com/questions/5254994/can-the-android-emulator-record-and-play-back-audio-using-pc-hardware">I阅读这里,使用麦克风是可能在Android模拟器,所以我决定尝试一下,(虽然一个答案,<一个href="http://stackoverflow.com/questions/5924190/how-do-you-enable-a-microphone-input-in-the-android-emulator">THIS问说,这是不可能的)
我复制/粘贴到 Android开发者网站,并添加

I READ HERE that using microphone might be possible in android emulator so I decided to try it out (Although an answer to THIS QUESTION says it's not possible)
I copy/pasted the code provided in the ANDROID DEVELOPERS WEBSITE and added

 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 <uses-permission android:name="android.permission.RECORD_AUDIO" />

到清单为好。该界面显示出来,有两个命令按钮,一个是开始记录和一个用于播放录音。在开始记录按钮的文本变为停止我一次记录preSS它,但如果我在停止录制按钮,挂起的应用程序进行排序,然后preSS崩溃(不幸的是,麦克风拍摄测试已停止。)。该logcat的话给出了此消息。

to the manifest as well. The interface shows up, with two command buttons, one for start recording and one for play recording. The text on the start recording button changes to stop recording once I press it, but if I press on the stop recording button, the application sort of hangs and then crashes (Unfortunately, Mic Rec Test has stopped.). The logcat then gives out this message

E/AudioFlinger(   40): Error reading audio input

E/AudioFlinger(   40): Error reading audio input

E/AudioFlinger(   40): Error reading audio input

E/AudioFlinger(   40): Error reading audio input

E/AudioFlinger(   40): Error reading audio input

E/AudioFlinger(   40): Error reading audio input

E/AudioFlinger(   40): Error reading audio input

E/AudioFlinger(   40): Error reading audio input

E/AudioFlinger(   40): Error reading audio input

E/AudioFlinger(   40): Error reading audio input

E/AudioFlinger(   40): Error reading audio input

一遍又一遍又一遍。事实上,它仍然这样做,因为我写了这个问题。这是什么意思?为什么当我点击停止录制程序崩溃?

over and over and over again. In fact, it's still doing it as I am writing this question. What does this mean, and why did the program crash when I clicked stop recording?

---编辑---
我只是通过点击的AVD管理和AVD细节中的详细... 按钮,检查了模拟虚拟设备的细节特性,我可以看到 hw.audioInput 设置为。这意味着,从仿真器录制音频应尽可能不应该吗?

---EDIT---
I just checked the emulated virtual device detail properties by clicking on the Details... button in the AVD Manager and in the AVD details box, I can see that hw.audioInput is set to Yes. This means recording audio from emulator should be possible shouldn't it?

---编辑2 ---
<一href="http://stackoverflow.com/questions/5472370/why-is-it-impossible-to-use-the-speech-recorder-on-the-android-emulator">Why是无法使用语音记录器在Android模拟器?

--- EDIT 2 ---
Why is it impossible to use the Speech Recorder on the Android emulator?

我看到模拟器配备了一个内置的语音记录仪应用程序,但问题还是一样,那一刻我点击记录,它崩溃。这是不够公平,但为什么在模拟器中的语音记录仪应用程序,如果仿真器是不应该有声音输入工作?还是我失去了一些东西在这里,它实际上是可能得到的录音机工作?

I saw that the emulator comes with a built in speech recorder app, but the problem is still the same, the moment I click on record, it crashes. That's fair enough, but Why have the speech recorder app in the emulator if the emulator is not supposed to work with sound input? Or am I missing something here, and it is in fact possible to get the sound recorder working?

推荐答案

看来,如果仿真器已经开始使用快照音频功能不起作用。即使没有快照,音频功能仍可能视电脑上,或可能无法正常工作。请参阅<一href="http://stackoverflow.com/questions/18179035/android-emulator-not-playing-any-sound-at-all-including-the-built-in-text-to-sp">HERE

It seems the audio features do not work if the emulator has been started using a snapshot. Even without the snapshot, the audio features still may or may not work depending on the computer. Please see HERE

这篇关于使用麦克风在Android模拟器(Java的+ Android的初学者)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆