I am assuming when you record your audio stream, the file is blocked
from playback.

Check out the following blog which talks about video streaming and
deals with a similar problem

http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/

--
Roman Baumgaertner
Sr. SW Engineer-OSDC
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.

On Oct 16, 5:20 am, Vishal <[email protected]> wrote:
> Hello,
>
> I have a Java application where in I am trying to read Audio samples
> from the mic into a buffer and then write the samples back to speaker
> from a buffer for playing.
>
> I have used AudioRecord and AudioTrack interfaces. Below are my
> configurations for the Record and Track object creation. AudioTrack(0,
> 8000, 2, 2, playBufSize, 1); AudioRecord(1, 8000, 2, 2, recBufSize);
> Using AudioRecord interface I am able to read the samples from mic
> continiously (8000 sampling rate and 640 samples per read). In the
> similar way I am also able to write some pcm samples to the speaker
> from a buffer and play it continuously using the AudioTrack interface
> (without record).
>
> But when I try to do both record and play simultaneously I am able to
> only record audio from mic but I am not able to play any samples to
> speaker. I am getting this error " ------- attemp playback while
> recording, cheat it! -----  " in the log cat.
>
> I have given the following permissions
> "android.permission.RECORD_AUDIO" and
> "android.permission.MODIFY_AUDIO_SETTINGS" in the Manifest file. I
> didn't find any special permission to play the audio.
>
> Is there anything else that I need to enable?
>
> Thanks in advance,
> Vishal
--~--~---------~--~----~------------~-------~--~----~
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