Chinaunix首页 | 论坛 | 博客
  • 博客访问: 382101
  • 博文数量: 119
  • 博客积分: 1796
  • 博客等级: 上尉
  • 技术积分: 890
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-14 10:16
个人简介

守正

文章分类
文章存档

2013年(1)

2011年(40)

2010年(78)

分类: 嵌入式

2010-07-06 09:44:03



Android AudioRecord errors
当前,该 论坛中首先显示的主题过多。要让该主题首先显示,请取消其他主题的这一选项。
处理您的请求时出错。请重 试。



标记
  共 7 个帖子 -   - 
您要发布帖子的论坛是一个。如果在此论坛发帖,互联网上的所有人都可以看到您的电子邮件地址。
您的回复帖子尚未发送。
发帖成功
取 消





发 送  放弃




发件人:
收件人:
抄送:
跟帖发送至:

添加抄送 | 添加跟帖 | 修改主题
主题:
验证: 出于验证的需要,请键入您在下图中看到的字符或点击辅助功能图标后所听到的数字。 听清并键入您听到的数字
发送  放弃





dmitriy325ci  
 
 更多选项 3月3日, 上午6时39分
发件人:dmitriy325ci
日期:Tue, 2 Mar 2010 14:39:05 -0800 (PST)
当地时间:2010年3月3日 (星期三) 上午6时39分
主题:Android AudioRecord errors
| | | | |
Hi Guys,
I am a newbie to android and was trying to get a simple recording
application up and running.  However I am facing errors and wondering
if some of you can point me in the right direction.

Stack Trace:
03-02 17:27:53.415: ERROR/AudioRecord(224): Could not get audio input
for record source 1
03-02 17:27:53.425: ERROR/AudioRecord-JNI(224): Error creating
AudioRecord instance: initialization check failed.
03-02 17:27:53.435: ERROR/AudioRecord-Java(224):
[ android.media.AudioRecord ] Error code -20 when initializing native
AudioRecord object.
03-02 17:27:53.487: ERROR/AudioRecord(224): Recording Failed
03-02 17:27:53.487: ERROR/AudioRecord(224):
java.lang.IllegalStateException: startRecording() called on an
uninitialized AudioRecord.
03-02 17:27:53.487: ERROR/AudioRecord(224):     at
android.media.AudioRecord.startRecording(AudioRecord.java:495)

Sample Code:
// Create a new AudioRecord object to record the audio.
int bufferSize =
AudioRecord.getMinBufferSize(AUDIO_SAMPLE_FREQUENCY_8000HZ,
                                                                    AudioFormat.CHANNEL_CONFIGURATION_MONO,
                                                                    AudioFormat.ENCODING_PCM_16BIT);
AudioRecord audioRecord = new
AudioRecord(MediaRecorder.AudioSource.MIC,
                                                                    AUDIO_SAMPLE_FREQUENCY_8000HZ,
                                                                    AudioFormat.CHANNEL_CONFIGURATION_MONO,

AudioFormat.ENCODING_PCM_16BIT,

bufferSize);
audioRecord.startRecording();

AndroidManifest.xml:
...
permission>
...

System Info:
Eclipse Galileo + SDK 2.1
IBM T60 running Windows XP

Thanks in advance,
Dmitriy


      







您需要先才能发帖。
要发帖子,您需要先。
请先在页上更新您的昵称,然后再进行发帖。
您没有发帖的权限。



Matias Alberto de la Vega  
 
 更多选项 3月3日, 下午8时15分
发件人:Matias Alberto de la Vega
日期:Wed, 3 Mar 2010 04:15:02 -0800 (PST)
当地时间:2010年3月3日 (星期三) 下午8时15分
主题:Re: Android AudioRecord errors
| | | | |
Dimitry, if I'm not wrong, Android currently only supports AMR_NB for
encoding+decoding, PCM is only supported for decoding so far. And the
file encapsulating this type encoding should be 3GPP (audio/3gp is the
MIME type which you may need). You can find more information about
MediaRecorder in developer.android.com, take care!

On 2 mar, 19:39, dmitriy325ci wrote:


      







您需要先才能发帖。
要发帖子,您需要先。
请先在页上更新您的昵称,然后再进行发帖。
您没有发帖的权限。



dmitriy325ci  
 
 更多选项 3月4日, 上午12时18分
发件人:dmitriy325ci
日期:Wed, 3 Mar 2010 08:18:57 -0800 (PST)
当地时间:2010年3月4日 (星期四) 上午12时18分
主题:Re: Android AudioRecord errors
| | | | |
Hmmm - I was under impression that PCM was supported.  I was looking
to use AudioRecord instead of MediaRecorder as I can then have direct
access to the buffer.

Is this not a valid example/tutorial then?

http://emeadev.blogspot.com/2009/09/raw-audio-manipulation-in-android...

Dmitriy


      







您需要先才能发帖。
要发帖子,您需要先。
请先在页上更新您的昵称,然后再进行发帖。
您没有发帖的权限。



dmitriy325ci  
 
 更多选项 3月4日, 上午4时25分
发件人:dmitriy325ci
日期:Wed, 3 Mar 2010 12:25:37 -0800 (PST)
当地时间:2010年3月4日 (星期四) 上午4时25分
主题:Re: Android AudioRecord errors
| | | | |
I figured out what the problem was.  I was trying to start recording
from 2 separate threads at the same time causing a conflict.

Although I solved the issue,  I am facing very poor audio quality.  I
tried using MediaRecorder as well with the same poor quality if not
worse.  I verified mic's quality via Audacity otherwise and found no
issues.

So it seems as if emulator might be offering poor support for audio
recording.  Am I missing something?  If this is indeed the issue with
emulator, what options do we have to create/test voice recognition
applications?

Dmitriy


      







您需要先才能发帖。
要发帖子,您需要先。
请先在页上更新您的昵称,然后再进行发帖。
您没有发帖的权限。



Matias Alberto de la Vega  
 
 更多选项 3月4日, 上午4时46分
发件人:Matias Alberto de la Vega
日期:Wed, 3 Mar 2010 12:46:06 -0800 (PST)
当地时间:2010年3月4日 (星期四) 上午4时46分
主题:Re: Android AudioRecord errors
| | | | |
Dimitry, I've used MediaRecorder in a Nexus One and the quality is not
that great either. Maybe there's something we can do to improve
quality, but I had no time to research on that. I will let you know if
I make progress getting better audio quality. Take care

On 3 mar, 17:25, dmitriy325ci wrote:


      







您需要先才能发帖。
要发帖子,您需要先。
请先在页上更新您的昵称,然后再进行发帖。
您没有发帖的权限。



dmitriy325ci  
 
 更多选项 3月4日, 上午11时48分
发件人:dmitriy325ci
日期:Wed, 3 Mar 2010 19:48:09 -0800 (PST)
当地时间:2010年3月4日 (星期四) 上午11时48分
主题:Re: Android AudioRecord errors
| | | | |
Wow, really?  One of the features of nexus one is voice search.  So
there is got to be a way to record audio on the device with acceptable
quality.   Unfortunately there is not much information available out
there.  So keep me posted if you make any progress.

Thanks,
Dmitriy

On Mar 3, 3:46 pm, Matias Alberto de la Vega


      







您需要先才能发帖。
要发帖子,您需要先。
请先在页上更新您的昵称,然后再进行发帖。
您没有发帖的权限。



Matias Alberto de la Vega  
 
 更多选项 3月4日, 下午12时08分
发件人:Matias Alberto de la Vega
日期:Wed, 3 Mar 2010 20:08:39 -0800 (PST)
当地时间:2010年3月4日 (星期四) 下午12时08分
主题:Re: Android AudioRecord errors
| | | | |
Voice search is great! how Google makes the magic happen remains a
mistery to me...so far at least. Take care!

On Mar 4, 12:48 am, dmitriy325ci wrote:


      







您需要先才能发帖。
要发帖子,您需要先。
请先在页上更新您的昵称,然后再进行发帖。
您没有发帖的权限。
帖子结尾
阅读(11061) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~