Hi Donal,

Yeah if you kick the record off and the play, then you can sit in a
loop reading the data out of Record and putting it into play (on a
thread other than the UI thread of course).

Not 100% sure about the earpiece, but you specify a stream when you
create the AudioTrack and I think a stream encpsulates audio routing
and volume amongst possibly other things.

If you set the stream to STREAM_VOICE_CALL it might come through the
earpiece as this is where a call would be routed, although I guess
that depends on headsets and stuff.

Can anyone clarify if I am right?

Mike

On Jan 21, 11:49 am, "draf...@gmail.com" <draf...@gmail.com> wrote:
> Hi Mike,
>
> Thanks for the prompt reply.
>
> I was looking at the AudioRecord class but had somehow missed the
> AudioTrack class,
>
> thanks for pointing it out.
>
> From looking at the classes I think what I have to do is read the
> recording data and put it straight into a streamed
> AudioTrack, would I be correct in saying that?
>
> And then is it possible to send it to the earpiece?
>
> Thanks again,
>
> Donal
>
> On Jan 21, 11:36 am, Michael <nicholls...@googlemail.com> wrote:
>
> > AudioRecord and AudioTrack are the classes you need.
>
> > If you use them in streaming mode then you can pipe data out of
> > AudioRecord straight into AudioTrack and you should be able to acheive
> > the desired effect.
>
> > I have done something similar, but without the delay.
>
> > Mike
>
> > On Jan 21, 11:28 am, "draf...@gmail.com" <draf...@gmail.com> wrote:
>
> > > Hi all,
>
> > > I was wondering is it possible with Android to record from the mic and
> > > play the sound back out the earpiece with just a 1 second delay?
>
> > > I have seen the tutorials and can currently record from the mike and
> > > save a 3gp file to the sd card.
>
> > > However is it posssible to record and say stream the audio straight to
> > > the ear piece with just a 1 - 2 second delay?
>
> > > If so how would I go about doing this?
>
> > > Would I need to record from the mic and save it to a file and then
> > > repaly to the ear piece? and continually do this?
>
> > > Or would it be possible to record from the mic and stream it directly
> > > to the ear piece with just a slight delay?
>
> > > Any help, info or directions to tutorials would be greatly
> > > appreciated,
>
> > > Thanks in advance
-- 
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

Reply via email to