简体   繁体   中英

Stream Java audio to an icecast/shoutcast server? Pipes and stdin?

I'm using a java music library called JavaMod. I want to stream the output of the java audio system to a shoutcast server.

"ezstream" is a command line tool that accept stdin and encode/stream it to an icecast/shoutcast server, but I'm not sure how to hook ezstream into the java audio system.

How do I 'register' the stdin of "ezstream" as a Java audio device so that a sample stream written to java's AudioSystem.sourceDataLine is directed to ezstream's stdin?

Option 1: System.out

You can simply write your audio data to System.out, and then pipe that output to ezstream.

$ java yourApp | eztream 

Option 2: PipedOutputStream

I believe you can pipe your audio data to a pipe, where the 'sink' is a pipe to ezstream. You'll have to look up examples for that, as I'm not familiar with doing that in Java, spicifically (but have done something similar in Perl).

I hope that helps - let us know if that works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM