Audio streaming from the web using Java

Adam Jansch's icon

Hi all,

I've been trying to find information about using Java to stream radio feeds from the web, but haven't really found anything. It is for a piece that will become a Max app when finished, so can't rely on any external applications (thus Soundflower and Jack are out), and I need to process the streams in MSP (so jit.qt.movie is not of much use).

I am under the impression that it can be done in Java, via mxj~, but my searches on the forum have come to nought. Can it be done? And if so does anyone have any idea where I can find some information on how to achieve this?

Thanks,

Hans Höglund's icon

Well your task consists of two steps: 1) obtain the streamed audio data 2) expose it to Max.

For the first part, some of these libraries might be useful:

For the second part, you need to someway convert the data to raw sample vectors (one float[] array per dsp cycle), and pass this to an outlet using the classes MSPObject and MSPSignal.

Hope this can get you started.

Adam Jansch's icon

Thanks for your reply Hans,

I've discovered both JMF and QTJ in the last couple of days, so I'm glad that I'm heading the right direction! There's also JLayer, which I'm checking out now (it looks simpler than JMF).