简体   繁体   English

将Java音频流式传输到icecast / shoutcast服务器? 管道和stdin?

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

I'm using a java music library called JavaMod. 我正在使用一个名为JavaMod的java音乐库。 I want to stream the output of the java audio system to a shoutcast server. 我想将java音频系统的输出流式传输到shoutcast服务器。

"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. “ezstream”是一个命令行工具,接受stdin并将其编码/流式传输到icecast / shoutcast服务器,但我不知道如何将ezstream挂钩到java音频系统。

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? 如何将“ezstream”的stdin注册为Java音频设备,以便将写入java的AudioSystem.sourceDataLine的示例流定向到ezstream的stdin?

Option 1: System.out 选项1:System.out

You can simply write your audio data to System.out, and then pipe that output to ezstream. 您可以简单地将音频数据写入System.out,然后将该输出传递给ezstream。

$ java yourApp | eztream 

Option 2: PipedOutputStream 选项2:PipedOutputStream

I believe you can pipe your audio data to a pipe, where the 'sink' is a pipe to ezstream. 我相信你可以将你的音频数据传输到管道,其中'sink'是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). 你将不得不为此查找示例,因为我不熟悉在Java中这样做,但是在Perl中做了类似的事情。

I hope that helps - let us know if that works. 我希望有所帮助 - 如果有效,请告诉我们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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