Make sure you're using 16 bit samples. 8 bit samples seem to just not
work. Don't use the default anythings - actually set it to MIC,
PCM_16BIT, 11025, MONO. Then once that works you can try tweaking
other options. Also, make sure your buffer is big enough - you can use
AudioRecord.getMinBufferSize to set up your recorder with a value with
minimal latency.

The way AudioRecord fails is really gross and uninformative. Hopefully
they'll fix that (and 8-bit recording) before 1.5 final...


On Apr 24, 4:42 pm, Dave Sparks <[email protected]> wrote:
> Is this on the emulator? If so, it may be a limitation of the
> emulator.
>
> On Apr 24, 3:25 am, szabolcs <[email protected]> wrote:
>
> > Steven,
>
> > Thank you for your reply.
>
> > I know AudioRecord works with a sample frequency of 8000Hz. In my
> > initial post I was asking why this frequency is the ONLY frequency
> > that works?!
>
> > BTW, there is no exception thrown when the initialization of
> > AudioRecord fails. I figured you are supposed to check that yourself
> > by something like:
> > if(mRecord.getState()==AudioRecord.STATE_INITIALIZED), not a try-catch
> > block.
>
> > So again: the question is, why does the initialization fail, if I
> > supply the constructor with AUDIO_SAMPLE_FREQ= 11025 || 22050 ||
> > 44100?
>
> > Thank you,
>
> > -Szabolcs
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to