JLayer is a decorator for Java Swing components, often used for for painting over and catching events from subcomponents in the Swing framework.
Questions tagged [jlayer]
136 questions
25
votes
3 answers
Music in JLayer stops when other apps play music
I have written a few hundred line app in Clojure that uses the JLayer Java library for audio where I run mp3s in the background. This works fine but as soon as I run any other music, YouTube etc in the background (I'm running Arch Linux) the sounds…

ChrisR
- 1,227
- 1
- 10
- 17
12
votes
3 answers
placing a transparent JPanel on top of another JPanel not working
I am trying to place a JPanel on top of another JPanel which contains a JTextArea and a button and i want to the upper apnel to be transparent. I have tried it by making the setOpaque(false) of the upper panel. but it is not working. Can anyone help…

Nikhil
- 2,857
- 9
- 34
- 58
8
votes
2 answers
AudioTrack - short array to byte array distortion using jlayer(java mp3 decoder)
I'm using jLayer to decode MP3 data, with this call:
SampleBuffer output = (SampleBuffer) decoder.decodeFrame(frameHeader, bitstream);
This call which returns the decoded data, returns an array of short[].
output.getBuffer();
When I call…

StackOverflowed
- 5,854
- 9
- 55
- 119
7
votes
3 answers
JLayer - Pause and resume song
I've noticed that a lot of topics were about pausing/resuming an MP3 using JLayer, so in order to help everybody, I've made a whole entire class designed just for that! Please see the answer below.
Note: This was for my personal use, so it may not…

Josh M
- 11,611
- 7
- 39
- 49
6
votes
4 answers
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(); …

Penchant
- 1,165
- 7
- 19
- 28
6
votes
3 answers
Circular Progress Bar for Java Swing not working
i've discovered this test project from Oracle site because i want to add a circular progress bar in my project.
I'm developing the application with Netbeans, and when i start the application, the JPanel where the circle should be.... disappaer.
I've…

Deviling Master
- 3,033
- 5
- 34
- 59
5
votes
1 answer
How to make a blurry JFrame/JDialog in Java using Swing and JLayer<>?
I am trying to blur my JFrames. The idea is to blur all components/controls within a JFrame using JLayer/LayerUI. Here's what I have done so far:
This is the LayerUI class that makes the blur effect:
import java.awt.Component;
import…

salocinx
- 3,715
- 8
- 61
- 110
5
votes
2 answers
Is it possible to know the duration of an MP3 before the entire file is downloaded?
This is a question about the file format of MP3s.
I've been hunting for a way to get an MP3 duration. Since I'm using JLayer SPI to decode the MP3 I've discovered that this is possible where the audio source is a file.
AudioFileFormat fileFormat =…

Philip Couling
- 13,581
- 5
- 53
- 85
5
votes
1 answer
Painting issue with JLayer and JPanel
I want to paint an icon when user's input is invalid. I've found an example by Oracle and modified it for my purposes. The painting of Icon works correctly but when I change the value to correct the icon goes not completly invisible: the part which…

Sergiy Medvynskyy
- 11,160
- 1
- 32
- 48
4
votes
2 answers
how do i find out duration/total play time of an mp3 file using java?
I am developing an application in Java. Part of it includes playing an mp3 file via another application. I need to find the duration (total play time) of the mp3 file. How do I do that?

shibi vb
- 41
- 1
- 3
4
votes
2 answers
LineUnavailableException for playing mp3 with java
My goal is to play an mp3 file from Java. With every approach that I took, it always fails with a LineUnavailableException.
AudioInputStream inputStream = AudioSystem.getAudioInputStream(new…

Thomas
- 435
- 1
- 5
- 12
4
votes
3 answers
How to properly detect, decode and play a radio stream?
I am currently trying to write a jukebox-like application in Java that is able to play any audio source possible, but encountered some difficulties when trying to play radio streams.
For playback I use JLayer from JavaZoom, that works fine as long…

TwoThe
- 13,879
- 6
- 30
- 54
4
votes
2 answers
Multiple JPanels completely on top of each other
I am creating an program in which I can draw a map and add different roads etc to it. I have planned to add the map terrain on one jpanel, and the roads etc on another, on top of each other. But I can't get them to work. I don't know how to add…

user2632928
- 41
- 1
- 2
4
votes
1 answer
Resize layer of JLayeredPane
I'm having a problem while trying to make my own chess game using JLayeredPane.
I got this far:
(Hopefully you can see block G6 has a green border on the label showing which block was selected)
But when I add my 2 SidePanels to my ChessBoard panel…

David Kroukamp
- 36,155
- 13
- 81
- 138
3
votes
1 answer
Using JLayer (AKA JavaLayer) to analyze mp3 files in java?
I would like to perform a FFT on frames of an MP3 file using Java (think spectrum analyzer). I found JLayer which seems to fit the requirement of MP3 Decoding, but I'm not sure how to use it (Most examples are simply players that use the higher…

Mike
- 526
- 7
- 18