언어 설정

Menu
Sites
Language
How to play audio from url stream?

I have a problem, my app is a playing audio music from Soundclound api, every test is good running in emulator, but if i test in real device my app can't playing audio. So i have question

How to play audio from url stream?

Responses

3 댓글
Ashish Patil

Hello Reky,

By what i understand that yur code works well in emlator and not on the device. May be the net speed is to blame. Also try using buffering. It might help on the device.

 

Cheers,

Aashish

Iqbal Hossain

Hi~

You didn't mention what procedure you followed for playing audio from url. 

You can play audio content in web application. 

Go to this link for help

https://developer.tizen.org/development/tutorials/web-application/w3chtml5supplementary-features/media/web-audio

 

To provide users with sophisticated audio features, you must learn to modulate source data into decoded audio data using XMLHttpRequest, and create an instance of the AudioContext interface. 

And 

Here is a guide with sample app

https://developer.tizen.org/community/tip-tech/working-web-audio-api

 

-Thanks

 

 

reky susanto

My code like this

 

$('.song').on('click', function(env){
   var audio = new Audio();
   audio.setAttribute('src', $(this).data('song-url')+ '?client_id=' + SC_CLIENT);
   audio.load();
   audio.play();
});

Maybe i'm must change use a arraybuffer. thanks