daredevil
daredevil

Reputation: 21

Soundcloud API return only mp3 formats?

I get track info from soundcloud, and use stream_url property for initialising html5 audio, but it works only in chrome, safari, and IE. How I can get .ogg track for opera and firefox, if it possible?

Upvotes: 2

Views: 1360

Answers (4)

nickf
nickf

Reputation: 545985

Opera and Firefox have support for MP3 HTML5 Audio now.

https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats

Upvotes: 0

twobob
twobob

Reputation: 348

Canvas.fm used Node.js to handle SoundCloud's incoming MP3 stream, and then piped this into ffmpeg, giving an OGG formatted audio stream could then be piped into an HTTP response.

Using Node.js makes this kind of stream handling incredibly simple and efficient.

REFS: http://en.wikipedia.org/wiki/Nodejs

http://canvas.fm (new details in comments below)

Hope that helps

Upvotes: 1

pedromtavares
pedromtavares

Reputation: 783

I suggest using node-lame to decode the mp3 stream to raw PCM data, then encode that stream into an ogg stream using node-ogg and then serve that to the clients. If you're not sure how to proceed with that I suggest reading this blog post from yours truly: http://pedromtavares.wordpress.com/2012/12/28/streaming-audio-on-the-web-with-nodejs/

Upvotes: 1

robb
robb

Reputation: 175

128 kbp/s mp3 is currently the only audio format available for streams on SoundCloud.

We've made some good experience with SoundManager 2 as it provides a Flash fallback for browsers that don't support mp3 natively.

Upvotes: 4

Related Questions