ok, but why must you address the samples as bytes? why not just deal
with them in their native format?
at a guess, the hardware doesn't support 8 bit recording. you could
scale the 16 bit samples down to 8 bit, but watch out for the fact
that 16 bit samples are signed, and 8 bit samples are not (usually).
hth
I agree Jason. It seems requesting the 16 bit format results in a
short array being returned: AudioFormat.ENCODING_PCM_16BIT.
For byte[], I would need to use this format: int audioEncodingFormat =
AudioFormat.ENCODING_PCM_8BIT;
Curiously it seems that AudioFormat.ENCODING_PCM_8BIT doesn't seem to
work. Other people have posted problems using
AudioFormat.ENCODING_PCM_8BIT.
Guess I'll stick with AudioFormat.ENCODING_PCM_16BIT and covert to
bytes afterwards:
pcmData[totalBytesRead] = (byte) tempBuffer[idxBuffer];
pcmData[totalBytesRead+1] = (byte) (tempBuffer[idxBuffer] >>> 8);
totalBytesRead += 2;
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
jason.vp.engineering.particle
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en