开发者

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

开发者 https://www.devze.com 2023-01-18 19:14 出处:网络
I\'m using a java music library called JavaMod.I want to stream the output of the java audio system to a shoutcast server.

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 开发者_JS百科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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号