javasound

How can I decode OGG vorbis data from a ByteBuffer?

时间秒杀一切 提交于 2019-12-25 09:27:01
问题 The libraries I founded so far only have methods to decode from a file or InputStream . I have a ByteBuffer with OGG vorbis data and I need it decoded to PCM without having to write it to a file first. 回答1: There seem to be 2 parts to this problem. 1) Getting Java Sound to deal with OGG Vorbis format. 2) Avoiding the File. For (1), the Java Sound API allows the addition of extra formats via the Service Provider Interface. The idea is to put an encoder/decoder into a Jar and use a standard

BigClip Won't Play .wav File

蹲街弑〆低调 提交于 2019-12-25 05:05:43
问题 I am attempting to add an audio player to my application. Here's the code from the class that handles audio playing: package me.pogostick29.audiorpg.audio; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; import javax.sound.sampled

BigClip Won't Play .wav File

蓝咒 提交于 2019-12-25 05:05:31
问题 I am attempting to add an audio player to my application. Here's the code from the class that handles audio playing: package me.pogostick29.audiorpg.audio; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; import javax.sound.sampled

How do I correctly use FloatControl with the Java Sound API?

给你一囗甜甜゛ 提交于 2019-12-25 04:03:17
问题 I am currently writing a test program in Java that I want to be able to control my computer's main SPEAKER with a JSlider on a GUI application. I have read through this page on the AudioSystem class and this page on Controls. It is my understanding that I need to get a Port or line through a mixer and then institute a Control on that line or port. Since I am controlling volume I need to implement a FloatControl . My program compiles with no problem, however when I run it and adjust the

How do I correctly use FloatControl with the Java Sound API?

断了今生、忘了曾经 提交于 2019-12-25 04:03:06
问题 I am currently writing a test program in Java that I want to be able to control my computer's main SPEAKER with a JSlider on a GUI application. I have read through this page on the AudioSystem class and this page on Controls. It is my understanding that I need to get a Port or line through a mixer and then institute a Control on that line or port. Since I am controlling volume I need to implement a FloatControl . My program compiles with no problem, however when I run it and adjust the

Internet audio player from java swing client?

守給你的承諾、 提交于 2019-12-24 23:26:30
问题 Im trying to implement and realtime audio streaming swing desktop app . trying to get bytes of audio using java.net classes and then feeding it to play . Just trying blind punches undersea water thinking the water tank will crack :(( help or any suggestion ? 回答1: One way could be to use the AudioSystem class. this allows you to get the AudioInputStream from a URL. 来源: https://stackoverflow.com/questions/2458221/internet-audio-player-from-java-swing-client

Problems using Java's Clip class

☆樱花仙子☆ 提交于 2019-12-24 12:00:30
问题 I'm having trouble using Java's Clip class in a game I've been developing. Specifically, I think the problem is in using the same clip multiple times simultaneously. I did some googling and some people suggested running the clip in its own thread. I wanted to copy the clip object so it would use a different clip object in every thread to avoid the need to "reset" the clip, but I'm still running into problems. In fact, the problem is that the game seems to freeze up when the same clip plays

Changing audio input using Java?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 10:34:44
问题 I'd like to modify the audio input stream, the stream that would come from my microphone. I have looked through the java.sound package API, but did not entirely understand it, nor how to modify direct sound input. Does anyone here know how to do that, or know an API that is capable of doing it? 回答1: You want a mixture of things: The Java Sound system: http://www.oracle.com/technetwork/java/index-139508.html A trail for it: http://docs.oracle.com/javase/tutorial/sound/index.html Using audio

Security Exception in self signed sound recorder Applet

廉价感情. 提交于 2019-12-24 06:44:21
问题 I have created an applet for recording sound. It throws an exception when I try to open a dataline. TargetDataLine.open() java.security.AccessControlException: access denied (javax.sound.sampled.AudioPermission record) My applet is self signed, all other jar files are self signed. Previously I was using a different thread to start the TargetDataLine and close the line. Afterwords instead of creating another thread, I switched to Executorservice . It works fine with thread but throws above

Javasound not playing .m4a files through JAAD (an SPI)

僤鯓⒐⒋嵵緔 提交于 2019-12-23 16:26:33
问题 I'm trying to play some .m4a files, and I understand that JAAD only supports decoding AAC, but there are songs that I am able to get the sourceDataLine from, and then when I go to try to play them, I get behavior like this: We read: 1024 bytes. We read: 512 bytes. We read: -1 bytes. When running this: // read from the input bytesRead = audioInputStream.read(tempBuffer, 0, tempBuffer.length); System.out.println("We read: " + bytesRead + " bytes."); until bytesRead == -1 For this particular