简体   繁体   English

在Java Swing App中从URL流音频

[英]Stream audio from URL in java Swing App

I want to play streaming audio from server in java swing app. 我想在Java swing应用中播放来自服务器的流音频。

There's a public live stream available at http://64.202.98.32:6210 . http://64.202.98.32:6210有一个公共直播流。

I have tried the java sound API without success: 我尝试了Java声音API,但未成功:

URL ur= new URL("http://64.202.98.32:6210");
AudioStream as = new AudioStream (url.openStream());

I also looked at Internet audio player from java swing client? 我还从java swing客户端看了Internet音频播放器?

How can I play live audio in swing app? 如何在Swing应用中播放现场音频?

There is an open-source project called FMJ at this link, maybe it can help -> http://fmj-sf.net/ 在此链接上有一个名为FMJ的开源项目,也许可以帮助-> http://fmj-sf.net/

But IMHO, instead of directly using a service, you may be able to get the streaming data from network with your Swing application, then play it using Java's Sound API. 但是恕我直言,您可以直接使用Swing应用程序从网络获取流数据,然后使用Java的Sound API播放它,而不是直接使用服务。

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

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