使用java播放多种声音并控制音量
我正在编写一个同时播放多个声音的应用程序,每个声音需要以不同的音量播放。一旦声音开始播放,我就不需要改变它的音量,这可能会在某种程度上简化事情。我找不到一个好的方法来做到这一点。
我找不到使用 Java 以设定音量播放 mp3 声音的方法。
JLayer 库似乎有一些更改音量的功能,但我找不到任何这方面的参考资料或教程,并且文档有点缺乏。
I'm writing an application which plays multiple sounds concurrently, each sound needs to be played at a different volume. Once a sound is playing I never need to change its volume, which may simplify things somewhat. I cannot find a good way to do this.
I can't find a way to play an mp3 sound at a set volume using Java.
The JLayer library seems to have some capabilities for changing the volume, but I cannot find any references or tutorials for this, and the documentation is a little lacking.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
除了 JLayer,您还可以查看 JMF。这是链接 http://java.sun。 com/javase/technologies/desktop/media/jmf/mp3/download.html
然后看起来你可以使用他们的媒体播放器控制音量。 http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/apidocs/javax/media/bean/playerbean/MediaPlayer.html 我希望这有帮助,但我没有尝试过,但链接看起来很有希望。
Instead of JLayer you could look into JMF. Here is the link http://java.sun.com/javase/technologies/desktop/media/jmf/mp3/download.html
Then it looks like you can control the volume using their media player. http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/apidocs/javax/media/bean/playerbean/MediaPlayer.html I hope this helps, I haven't tried it but the links look promising.