jlayer

Playing only one mp3 file in a thread using JLayer in java issue

十年热恋 提交于 2019-12-10 11:58:13
问题 I'm working at an Audio Player, which is written in Java with GUI. For playing the mp3 files, I've chosen JLayer library from javazoom because I saw it's very popular and used. I made the GUI, managed to play the selected mp3 file from the playlist. My problem is that if I press many times on the play button or on the file from the playlist it will start playing the song as many times as I press it and I want to play it one the same thread ; if I press again play button I want to play again

placing a transparent JPanel on top of another JPanel not working

狂风中的少年 提交于 2019-12-10 02:15:45
问题 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 me to get through this? Thanks in advance! public class JpanelTest extends JPanel { public JpanelTest() { super(); onInit(); } private void onInit() { setLayout(new BorderLayout()); JPanel panel = new JPanel(); panel.setLayout(new BorderLayout());

Changing volume in Java when using JLayer

非 Y 不嫁゛ 提交于 2019-12-06 01:52:31
问题 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.getInputStream()/*new FileInputStream(quick_file)*/); System.out.println(bitstream); decoder = new Decoder(); decoder.setEqualizer(equalizer); audio = FactoryRegistry

placing a transparent JPanel on top of another JPanel not working

南楼画角 提交于 2019-12-05 01:06:51
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 me to get through this? Thanks in advance! public class JpanelTest extends JPanel { public JpanelTest() { super(); onInit(); } private void onInit() { setLayout(new BorderLayout()); JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); panel.add(new JTextArea(100,100),BorderLayout.CENTER); panel.add(new JButton("submit"),BorderLayout

Changing volume in Java when using JLayer

余生长醉 提交于 2019-12-04 05:51:17
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.getInputStream()/*new FileInputStream(quick_file)*/); System.out.println(bitstream); decoder = new Decoder(); decoder.setEqualizer(equalizer); audio = FactoryRegistry.systemRegistry().createAudioDevice(); audio.open(decoder); for(int i = quick_positions[0]; i > 0; i--){ Header

Adjusting Volume using JLayer

假如想象 提交于 2019-12-01 14:03:28
问题 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 I didn't want to respond to such an old question so I thought I'm just gonna ask again. Cheers Timothy 回答1: The easiest way to do this is to use jlayer via mp3spi which

Java Jlayer Mp3 Player - how to repeat and stop song [closed]

时光毁灭记忆、已成空白 提交于 2019-12-01 13:00:41
I have problem with mp 3 player. I'm using jLayer. This is my code private void formWindowOpened(java.awt.event.WindowEvent evt) { new Thread (){ public void run(){ try { Player prehravac; FileInputStream buff = new FileInputStream(Okno.filename); prehravac = new Player(buff); prehravac.play(); if (prehravac != null) { prehravac.play(); } } catch(Exception e) { } } }.start(); } In my application I need to play song from the beginning to the end. So when song ends I need to start it again and when window closes I want to stop this song... JLayer does not support continuous play, so you have to

Java Jlayer Mp3 Player - how to repeat and stop song [closed]

人盡茶涼 提交于 2019-12-01 10:55:34
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 8 months ago . I have problem with mp 3 player. I'm using jLayer. This is my code private void formWindowOpened(java.awt.event.WindowEvent evt) { new Thread (){ public void run(){ try { Player prehravac; FileInputStream buff = new FileInputStream(Okno.filename); prehravac = new Player(buff); prehravac.play(); if (prehravac !=

Decoding MP3 files with JLayer

天涯浪子 提交于 2019-12-01 07:14:04
问题 I want to use JLayer to decode an MP3 file. I have searched and searched for documentation and examples on how exactly to do this, and have turned up nothing of use. Everything I find is embedded in other examples or references JavaSound, which is unacceptable in my case. I feel like this is incredibly easy, but I can't figure out how to do it. I don't know what the parameters are for Decoder decoder = new Decoder(); decoder.decodeFrame(Header header, Bitstream stream); or how to obtain them.

Circular Progress Bar for Java Swing not working

╄→гoц情女王★ 提交于 2019-11-30 08:42:45
问题 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 removed all the code that is not useful to solve this problem and i've got this code: import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.beans.PropertyChangeEvent; import javax.swing.*; import