jlayer

Changing Volume with JLayer

跟風遠走 提交于 2021-01-23 07:54:14
问题 I have a very specific problem with JLayer in my Music-Player project. I want to include something to adjust the volume, but it seems it isn't that easy to implement. This is because JLayer isn't supporting it from itself. I excluded the Player class from my project and changed some methods and it works fine for playing mp3 . For adjusting the volume I added to the Player class this method: public boolean setGain(float newGain) { if (audio instanceof JavaSoundAudioDevice) { System.out.println

Changing Volume with JLayer

China☆狼群 提交于 2021-01-23 07:53:26
问题 I have a very specific problem with JLayer in my Music-Player project. I want to include something to adjust the volume, but it seems it isn't that easy to implement. This is because JLayer isn't supporting it from itself. I excluded the Player class from my project and changed some methods and it works fine for playing mp3 . For adjusting the volume I added to the Player class this method: public boolean setGain(float newGain) { if (audio instanceof JavaSoundAudioDevice) { System.out.println

jlayer.javazoom player can not stop mp3

自作多情 提交于 2020-06-18 05:39:32
问题 How to stop MP3 in jlayer? ( the stop() is no longer used) My code as follows: //main class mp3_main private AdvancedPlayer player; public static void main(String[] args) { String file="C:\\cd.mp3"; mp3PlayerSample mp3 = new mp3PlayerSample(file); mp3.play(); mp3.stop(); } //class mp3PlayerSample private String filename; private BufferedInputStream buffer; private AdvancedPlayer player; //constructor public mp3PlayerSample(String filename) { this.filename = filename; } //start method public

How to make a blurry JFrame/JDialog in Java using Swing and JLayer<>?

帅比萌擦擦* 提交于 2020-01-13 10:11:32
问题 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 java.awt.Graphics; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.awt.image.BufferedImageOp; import java.awt.image.ConvolveOp; import java.awt.image.Kernel; import javax.swing.JComponent; import javax.swing.plaf.LayerUI; public class

Playing streamed mp3 data repeatedly with jlayer

可紊 提交于 2019-12-24 16:42:46
问题 I am working on an mp3 streaming application in Java. The user at the server end plays a music file at the server end (although the server is just currently sending the file) and the player at the client end reads the stream and plays the music. I'm using JLayer to play the music file. The server sends the files in chunks and also receives the file in chunks and plays it. I'm using jgroups library for group membership management as I plan to scale the application to be used by many clients.

Loading an mp3 file with JLayer from inside the Jar

本秂侑毒 提交于 2019-12-24 14:35:34
问题 I want to load an mp3 file from inside the jar file itself and then play it with JLayer. When I try to do it, I either get a NullPointerException or a FileNotFoundException. Any idea on how to fix this? //MP3Player.java package Music; import java.io.BufferedInputStream; import java.io.FileInputStream; import javazoom.jl.player.Player; public class MP3Player extends Thread { private String filename; private Player player; private Thread mp3Thread; private boolean playing; private boolean

Introducing JLayeredPane to an existing JFrame

馋奶兔 提交于 2019-12-24 10:59:02
问题 I've been staring at Oracle's JLayeredPane tutorials but they are laid out in a manner that is confusing to me and doesn't get at what I am trying to do. I have an application that up to now has had no concept of layers. Everything is laid out in a single layer, inside a JFrame. I now want to introduce a component that appears sporadically, as needed, in a certain location, overlaying existing components that stay there normally. Do I have to modify my existing application JFrame so that all

Slow MP3 decoding on Android using jlayer

你说的曾经没有我的故事 提交于 2019-12-24 10:56:40
问题 It require 1 minute to decode 10 seconds, how can I decode the MP3 faster? public static byte[] decode(String path, int startMs, int maxMs) throws FileNotFoundException { float totalMs = 0; ByteArrayOutputStream os = new ByteArrayOutputStream(); File file = new File(path); InputStream inputStream = new BufferedInputStream(new FileInputStream(file), 8 * 1024); try { Bitstream bitstream = new Bitstream(inputStream); Decoder decoder = new Decoder(); boolean done = false; while (! done) { Header

“Whiteout” entire swing GUI except from one component

丶灬走出姿态 提交于 2019-12-24 09:12:57
问题 [This question is in relation to this question] Setting : I have this home-crafted "editable label" component which looks like a label, but when you click it, it turns into an editable field, allowing you to edit it. You can hit Esc to cancel, or Shift-Enter to OK your edits - or click the respective buttons beneath the editable field. The Challenge : When hitting edit, I want the entire UI to be "whited out", except for the edit-label's area, to clearly denote to the user where it is

Use AudioTrack with JLayer decoder

六月ゝ 毕业季﹏ 提交于 2019-12-24 00:55:46
问题 I'm working on the Android application which is using JLayer library to decode MP3 file (I need access to audio samples) and AudioTrack object to play it. I have something like this: int timeMarker = 0; int timeStep = 5000; while (!isCancelled()) { outSignalBuffer = decode(fileToPlay.getPath(), timeMarker, timeStep, bufferSize); audioTrack.write(outSignalBuffer, 0, outSignalBuffer.length); //publishProgress(outSignalBuffer); timeMarker += timeStep; } This code is placed in my custom player