when you set properties explicitly,
be sure to set the correctly based on stream...
you cant hard code the values..

Stream properties --. track properties...

On Mon, Feb 15, 2010 at 4:42 PM, kavitha <[email protected]> wrote:

> Hi All,
>
> I want to play music from online mp3 link.
>
> I am reading the music data into a stream and trying to play it using audio
> track.
>
> But itz giving only noise.No music i could listen.
>
> This is my code.
>
> int  intSize = android.media.AudioTrack.getMinBufferSize(8000,
>                     AudioFormat.CHANNEL_CONFIGURATION_MONO,
>                     AudioFormat.ENCODING_PCM_16BIT);
>
>    AudioTrack        oTrack = new AudioTrack(AudioManager.STREAM_MUSIC,
> 8000,
>                         AudioFormat.CHANNEL_CONFIGURATION_MONO,
>                         AudioFormat.ENCODING_PCM_16BIT, intSize,
>                         AudioTrack.MODE_STREAM);
>
>  oTrack.play();
>  oTrack.write(buffer, 0, buffer.length);
>
>
> here buffer is the audio data i am reading into.
>
> Same buffer I can play in MediaPlayer,,,But i could not play in
> audiotrack..
>
> Please tell me the solution.
>
> It is urgent.
>
> Thanks
> Kavitha
>
> --
> 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]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en




-- 
Thank you,
Dilli Rao. M
www.arijasoft.com

-- 
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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to