Just to update you a bit this code works in 1.5 :
audio_service.setSpeakerphoneOn(false); audio_service.setMode(AudioManager.MODE_IN_CALL); audio_service.setRouting(AudioManager.MODE_NORMAL, AudioManager.ROUTE_EARPIECE, AudioManager.ROUTE_ALL); However I've yet to find a solution for 1.6 + Any help would be greatly appreciated Thanks On Mon, Jan 25, 2010 at 9:19 AM, Donal Rafferty <draf...@gmail.com> wrote: > Hi Ani, > > I am working on 1.5 (CupCake) and have tried to use the setRouting method, > however the audio still appears to be coming out of the speaker. > > I also have an eclair device and the audio is coming out of the speaker on > that device too. > > I have tried using the Audiomanager and the STREAM_VOICE_CALL also but with > no luck at all. > > My code is posted above in case I may be using the methods the wrong way? > > > On Mon, Jan 25, 2010 at 3:09 AM, ani <anish198519851...@gmail.com> wrote: > >> >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? >> >> As for earpiece routing we can route audio to earpiece using >> setrouting call in the case of cupcake.In case of ECLAIR you can use >> various custom api's provided by android to route it to earpiece >> (google it).You need to set the route explicitly to get the audio out >> of earpiece or any other place.STREAM_VOICE_CALL will work i think but >> not 100% sure.Please check in case you are not getting let me know. >> >> -- >> 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<android-developers%2bunsubscr...@googlegroups.com> >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en >> > > -- 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