jlayer

Changing volume in Java when using JLayer.

I'm using JLayer to play an inputstream of mp3 data from the internet. How do i change the volume of the output? I'm using this code to play it: URL u = new URL(s); URLConnection conn = u.openConnection(); conn.setConnectTimeout(Searcher.timeoutms); conn.setReadTimeout(Searcher.timeoutms); bitstream = new Bitstream(conn.getInputSt...

Specifying start/stop time in millisecs when playing MP3 using JLayer

I need to play a part of an MP3 file in my java code. I wish to do this via a function which accepts the start and stop time in millisecs. JLayer contains a class called AdvancedPlayer which has a method that accepts the start and stop position in frames: /** * Plays a range of MPEG audio frames * @param start The first frame to play...

MP3 Compression i.e converting mp3 file from 256kbps to 128kbps in java..

i want to achieve mp3 compression.. it means i want to convert a 256kbps mp3 file into a 128 or even 64kbps mp3 file using java programming language.. is it possible using JLayer..? how do i do it..? A code snippet would be useful. Thanks in advance..!! ...

What should i prefer...JLayer or LameOnJ?

Hello, I am about to create a mini project in Java related to MP3. These are the 3 things i will be doing in it. 1) Playing a MP3 file (as we do in a VLC media player with all the play,pause,stop functions) 2) Converting a MP3 file to .WAV file and vice versa 3) Compressing a MP3 file from 256kbps to 128 or 64kbps(depends on the user...

Only one thread at a time!

Hey there! Here's my code: new Thread() { @Override public void run() { try { player.play(); } catch ( Exception e ) { System.out.println(e); } } }.start(); which creates and starts a thread. I'd like to modify this code so that the thread only starts if there are no other threads open at the time! If ther...

Playing multiple sounds and controlling the volume using java

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 libr...

LineUnavailableException for playing mp3 with java

Hi, my goal is to play an mp3 file from Java. With every approach that I took, it always fails on a LineUnavailableException. AudioInputStream inputStream = AudioSystem.getAudioInputStream(new URL("http://localhost:8080/agriserver/facebook/sound/test6.mp3")); Clip clip = AudioSystem.getClip(info); clip.open(inputStream); ...

Adjusting Volume using JLayer

Hey there, me and a friend are programming a MP3 Player as a schoolproject. We are nearly finished and now stuck at the point where we try to programm a function to change the volume of the player. We are using: AudioDevice AdvancedPlayer I know someone else asked the same question allready but I did not quite get the solution and...