为什么无法使用语音记录器在Android模拟器?记录器、模拟器、语音、Android

2023-09-13 01:02:40 作者:安然.

我试图运行自带了Android 2.2模拟器语音记录器。问题是,现在我点击记录按钮:

I am trying to run the Speech Recorder that comes with the Android 2.2 emulator. The problem is that the moment I click the "Record" button:

它中止并显示错误消息应用程序语音记录器(过程com.android.speechrecorder)已意外停止,请重试。

It aborts with an error message "The application Speech Recorder (process com.android.speechrecorder) has stopped unexpectedly. Please try again."

问题是,试图再次没有帮助。

The problem is that trying again doesn't help.

现在,我搜索计算器和我梳理了整个互联网,我发现了同样的问题,许多报告,没有任何工作的解决方案。

Now, I searched StackOverflow and I combed the entire Internet and I found many reports of the same problem, without any working solution.

我的结论是,一些奇怪的原因,Android模拟器能够用于输出的Windows音频设备,而不是投入。

My conclusion is that, for some strange reason, the Android emulator is capable of using the Windows audio device for output, but not for input.

这是为什么?

我知道其他虚拟化软件(例如VMWare)都没有问题使用主机的音频设备的输出和输入的部分。

I know that other virtualization software (e.g. VMWare) have no problem using both output and input sections of the host's audio device.

另外,如果语音记录器从来没有做过的仿真器的人,为什么把它放在那里?

Also, if Speech Recorder never worked for the emulator for anyone, why put it there?

这肯定曾有人。有没有一种方法,使语音记录仪工作对我来说,太?

Surely this has worked for someone. Is there a way to make Speech Recorder work for me, too?

我使用Windows XP 32-bit和我的AVD中定义了一个SD卡(安装在开始)。

I am using Windows XP 32-bit and my AVD is defined with an SD card (mounted upon start).

更新:我遵循的建议下@Klaus,试图看到任何异常是否抛出。我只需键入这样做的 ddms.bat 在命令行启动DDMS的单机版(带显示器的logcat在底部)。果然,我在单击录制按钮,出现以下异常:

Update: I followed the suggestion by @Klaus to try and see whether any exceptions are thrown. I did so by simply typing ddms.bat at the command line to launch a stand-alone version of DDMS (with a logcat display at the bottom). Sure enough, I receive the following exception upon clicking the "Record" button:

03-29 14:16:58.195: ERROR/AudioRecord(303): Could not get audio input for record source 1
03-29 14:16:58.195: ERROR/srec_jni(303): initCheck error -22 
03-29 14:16:58.205: DEBUG/SpeechRecorderActivity(303): run audio capture thread
03-29 14:16:58.205: WARN/dalvikvm(303): threadid=8: thread exiting with uncaught exception (group=0x4001d800)
03-29 14:16:58.215: ERROR/AndroidRuntime(303): FATAL EXCEPTION: Thread-9
03-29 14:16:58.215: ERROR/AndroidRuntime(303): java.lang.NullPointerException
03-29 14:16:58.215: ERROR/AndroidRuntime(303):     at com.android.speechrecorder.SpeechRecorderActivity$4.run(SpeechRecorderActivity.java:192)
03-29 14:16:58.285: WARN/ActivityManager(59):   Force finishing activity com.android.speechrecorder/.SpeechRecorderActivity
03-29 14:16:58.904: DEBUG/dalvikvm(59): GC_FOR_MALLOC freed 13324 objects / 656184 bytes in 197ms
03-29 14:16:59.915: INFO/ARMAssembler(59): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x20db68:0x20dc24] in 1247352 ns
03-29 14:17:05.251: DEBUG/SpeechRecorderActivity(303): stopRecording

我如何从这里出发?我没有写的语音记录仪应用程序,所以我不知道是什么原因导致NullPointerException异常的SpeechRecorderActivity.java线192我相信这已经是与先前的logcat的消息:

How do I proceed from here? I didn't write the Speech Recorder app, so I don't know what causes the NullPointerException at SpeechRecorderActivity.java line 192. I believe this has something to do with an earlier logcat message:

无法获取音频输入备案   源1

Could not get audio input for record source 1

但问题又是为什么呢?

为什么是不是能够获取音频输入的记录源1?

Why wasn't it able to "get audio input for record source 1"?

推荐答案

你有此问题的原因是,仿真器不具有audioInput挂钩。最好的办法是插入一个真实的设备,做测试在那里。

The reason you're having this issue is that the emulator doesn't have an audioInput to hook. Your best bet is to plug a real device in and do testing there.

 
精彩推荐
图片推荐