Streaming audio via html5/js (a la radio)? - javascript

Is there a library or technique out there that will let me embed a streamed audio source in a webpage? I've seen other SO answers recommending audio.js for similar requests, but it looks like that will only let you pick a single audio file.
While I guess I could put a bunch of effort into making a file-like audio stream, I feel like there has to be a better way to go about this.

Looks like the best thing for the job is one of the use-cases of jPlayer; will update if problems crop up or something better rears its head.

Related

JavaScript - Convert webm to mp4

I have looked a bit around, but I couldn't find a proper library and everyone point at a different direction.
So my question is simple; is it possible to convert a media (webm) on a web page to mp4 and immediatly start the download ?
I'm making an extansion for firefox, but I have no idea how to do the conversion part.
I wouldn't recommend handling something as complicated as conversion by yourself, and instead would use something like https://cloudconvert.com/api as a background service, so your plugin will query that API upload/download, and output to the users browser.

Recognize a song with a media stream in javascript

I was wondering if there is a way to recognize a song based on a media stream, because i want to capture the audio of a tab in google chrome and then know what song it is.
So far the only thing i really found was a song recognizer with an mp3 file, but i was wondering if there is an api or something that i can do it with a stream.
Yes, there actually are a couple of different API's out there, the most popular one (and IMO the best one) being Echoprint.
Good luck with your coding!

Create video stream from html5 <canvas>

I have a audio visualizer written in JS which draws on a <canvas> element.
Is it possible (without screen-capture) to turn that <canvas> into a (realtime) video stream? Perhaps somehow write it to a socket directly.
the JS uses THREE.js for rendering.
Preferrably I'd like to be able to run this on a webserver, it's probably not possible to do this without actually using a browser, but if it is, I'd be very happy to hear about it ;)
Using the info from Blindman67 I've managed to figure out a way of achieving the desired result.
I will end up using PhantomJS and have it write images to a /dev/stdout (or other socket) and use ffmpeg to turn that into a videostream. (sort of as described in this question)
I will also run a test using Whammy but as described in the github that might not produce the desired result; only 1 way to find out.
Edit: I will also try the suggestion from kaiido to use WebRTC

How do I use jsmad?

jsmad is a new JavaScript based MP3 decoder (GitHub, demo), but it seems to be lacking any documentation at all. I can't really work out what a lot of the demo is doing either, and the actual JavaScript seems minified.
Is anyone able to write up some documentation here for someone that just wants to play MP3 audio, please? It looks like a few people are giving up because of the lack of documentation.
I sent an email over to Amos Wenger, one of the developers for jsmad, who had this to say:
Hi there!
Yes, we are very much aware of the lack of documentation. There are
two reasons for that:
First, the bad news: jsmad only does MP3 -> raw audio, whereas people
expect a much more complete piece of software (similar to HTML5 audio,
which does HTTP streaming, buffering, decoding, audio sink, UI
controls, events etc.) As I mentioned in my jsmad slides at jsconf.eu,
we need to flesh out several other components before we have a real
competitor for Flash-based audio playback on your website. So in a
way, the lack of docs is because we don't want end-users to start
deploying it on their website just yet! It's not ready for prime time.
At ofmlabs (Official.fm's R&D division, among other stuff) we had a
lot of internal projects going on, and have only recently been able to
re-focus on open source. So that's the good news: we'll have more time
to spend on stuff like jsmad, and will probably work on the missing
parts (buffering, proper demuxing - probably via aurora.js, etc.)
As for 'docs', there are a little in my slides (mentioned above), and
well mhd.js is not minified so you can always take a look at
http://jsmad.org/mhd.js ;)
Cheers, Amos
So it looks like jsmad isn't up for public use just yet, but we can look forward to further support in the future. :)

Free audio players for website streaming

Are there any free audio players that I can use in my website? Are they customizable?
I've heard of Soundmanager 2. It's a flash based player with a javascript front-end.
Are there any other free players like that?
If you'd like something that doesn't require loading a Flash plugin, try jPlayer. It uses HTML 5 when the browser supports it.
I like this one. Simple to use and nice looking.

Categories