Questions tagged [audioinputstream]

AudioInputStream is a class in the Java package javax.sound.sampled. It's used for reading raw audio data from e.g. typically a file or microphone.

AudioInputStream is a class in the Java package . It's used for reading raw audio data from e.g. typically a file or microphone.

44 questions
4
votes
1 answer

Retrieving the title, artist/author and duration of a .wav file

I am trying to get the properties of a .wav file I am using in my Java project using the following code. However when I run this code the methods format.getProperty("title"), format.getProperty("author"), and format.getProperty("duration") all…
Dan
  • 5,704
  • 4
  • 31
  • 75
2
votes
1 answer

Restarting and pausing and resuming clip hangs the gui of music player, while pressing pause and play resumes playing from stopping point

This program is a music player that allows user to pick a .wav file, play, pause, resume, and restart a the music file from a clip object and audioinput stream. The audio input stream loads a file that is determined by user via FileChooser. The…
2
votes
0 answers

Google Speech-to-Text for streaming audio with Java

I am trying to use the Google Speech-to-Text API to do some voice-to-voice translation (also using Translation and Text-to-Speech). I would like for a person to speak into the microphone and for that text to be transcribed to text. I used the…
g123
  • 21
  • 1
2
votes
1 answer

Save ogg stream provided by AWS Polly into a wav file

I am trying to create a webpage, where user will be able to listen to the text he types. I also want to provide a functionality to download the media in .wav format. I am able to get AudioStream from AmazonPollyClient but not able to save the stream…
Dave Ranjan
  • 2,616
  • 22
  • 44
2
votes
0 answers

Playing Sound From .jar File

I have looked at countless different StackOverflow answers as well as answers from other sites, but none of the solutions have fixed my problem. I cannot for the life of me get my .wav file to play. Here is my code: Sound class: public class Sound…
1
vote
1 answer

Why is my game lagging when I play this .wav file?

So I am making a game, and I noticed that when I attempted to play audio when the player levels up it lags the whole game for a split second. public void tick() is called 60 times in a second. And I have already tested it and the only thing lagging…
Zeeen
  • 194
  • 1
  • 12
1
vote
2 answers

How do I change the decibels of a clip

The problem I have is that the decibals of the audiofile only changes from the initial value of programVolume (the variable) but I have a JSlider that alters the the value of the variable;however, it does not alter the decibals of the file. What do…
1
vote
2 answers

Java AudioInputStream how to support skip with negative number of bytes

I am trying to skip a negative number of bytes with AudioInputStream skip(long bytes) method . The problem is trying to (let's say a small number of bytes...) : int skipped = audioInputStream.skip(-bytes); always returns 0 as described on this…
GOXR3PLUS
  • 5,939
  • 3
  • 30
  • 79
1
vote
2 answers

Increase/decrease audio play speed of AudioInputStream with Java

Getting into the complex world of audio using Java I am using this library , which basically I improved and published on Github. The main class of the library is StreamPlayer and the code has comments and is straightforward to understand. The…
GOXR3PLUS
  • 5,939
  • 3
  • 30
  • 79
1
vote
1 answer

How to append multiple files to Audio InputStream

I have an audio player, I have found how to add a single file to the audio inputstream, but I have an arraylist of files I want to add. How should I do that? public class AudioPlayer { Long currentFrame; Clip clip; // current status of…
Daniel Haughton
  • 745
  • 1
  • 12
  • 26
1
vote
1 answer

while loop does not seem to work when I delete System.out.println

So this while loop pretty much do nothing until I change the value of bgmPlaying. It works fine. However, if I delete the parts that says //testing above it(without any line breaks), it does not work. This block of code actually keeps checking…
Al Nafis
  • 87
  • 8
1
vote
1 answer

Get AudioInputStream of FloatBuffer

I have a callback that gets incoming audio data as FloatBuffer containing 1024 floats that gets called several times per second. But I need an AudioInputStream since my system only works with them. Converting the floats into 16bit PCM isgned audio…
piegames
  • 673
  • 10
  • 26
1
vote
1 answer

AudioSystem Write, AudioInputStream from modified bytes obtained from InputStream, Java

I obtaining bytes from InputStream, but I need to modify and save them to Wav File. Here my code: Socket Sending Audio Obtained from Microphone. AudioFormat adfmt = new AudioFormat(8000.0f, 8, 1, true , true); int bufferSize = (int)…
Chepe Questn
  • 552
  • 2
  • 13
1
vote
0 answers

How to write a generated audio into a .wav format in java

I am very new in Java Sound and therefore my concepts of it are not that strong. I want to understand that how to write the audio generated by the following code into a file of .wav format. I had read a few posts and some questions on stackoverflow…
1
vote
0 answers

Multiple Audio Lines from DAC in Java

I am working on a live music visualization project in Java (technically Processing, but we're using Eclipse) that requires audio input from multiple mics at the same time. We had a good system going with JACK (as per the answer to this question),…
1
2 3