jlayer

JLayer - Pause and resume song

放肆的年华 提交于 2019-11-30 08:35:43
问题 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 be as robust as some people were hoping. But it is not that hard to make simple modifications, due to its simplicity. 回答1: A very simple implementation of a player that is really pausing playback. It works by using a separate thread to play the

AudioTrack - short array to byte array distortion using jlayer(java mp3 decoder)

一曲冷凌霜 提交于 2019-11-30 03:57:01
问题 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 AudioTrack write() with that method, it plays fine as I loop through the file: at.write(output.getBuffer(), 0, output.getBuffer().length); However, when I convert the short[] array to byte[] array using any of the methods in this answer: https://stackoverflow

FileNotFoundException, the file exists Java [closed]

僤鯓⒐⒋嵵緔 提交于 2019-11-29 16:07:28
I have a very strange issue, I'm trying to play some MP3s with some Java code and JLayer. I have a method setup to generate the file path, but it's giving me a ton of grief. Here is the return statement (and all the code involved in the method): private static String findSoundFile(String numSeq) { return "file:///Users/user/Desktop/FinishedPhone/" + numSeq + ".mp3" } I have a set of maybe ~150 mp3 files, all named 1.mp3, 2.mp3 etc. They go up to about 156 (there's some missing in between). Based on user input of a 3 digit code, it plays one of the sounds. This code works flawlessly for

Circular Progress Bar for Java Swing not working

倾然丶 夕夏残阳落幕 提交于 2019-11-29 07:37:30
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 javax.swing.plaf.LayerUI; public class Loading_Test extends javax.swing.JFrame { static final

FileNotFoundException, the file exists Java [closed]

眉间皱痕 提交于 2019-11-28 09:56:23
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . I have a very strange issue, I'm trying to play some MP3s with some Java code and JLayer. I have a method setup to generate the file path, but it's

Zooming JLayeredPane via JLayer and the LayerUI

前提是你 提交于 2019-11-27 15:54:59
It's been suggested on this Stack Overflow question that the best way to implement zooming in Swing applications is via the JLayer decorators provided with Java 7. I've been following the Oracle tutorial and think the best way to do this is by creating my own ZoomUI that extends the LayerUI . My thoughts so far are that this class will have a zoom member variable that is applied before painting the actual component. Then later on I can then use this same class to catch mouse events and dispatch them to their un-zoomed coordinates. I'm having a little trouble with the first step and cannot

Secure Desktop Mode effect for java application

三世轮回 提交于 2019-11-27 09:36:24
Does anyone now how to achieve a "Secure-Desktop Mode" (effect) such as one gets from the Windows Vista/7 UAC consent-blocks? I assume it is some function which will remove pixels here-and-there (and possibly graying them) and then finally drawing that to screen... I would like to apply it to my application to keep the user from doing anything until the another user connects to the system (but that is besides the point) I would really appreciate the advise. Kind regards A EDIT: i was really only looking for this graphicsFX.setColor(new Color(0, 0, 0, 0.8f)); graphicsFX.fillRect(0, 0, 800, 600)

Secure Desktop Mode effect for java application

旧巷老猫 提交于 2019-11-26 14:47:18
问题 Does anyone now how to achieve a "Secure-Desktop Mode" (effect) such as one gets from the Windows Vista/7 UAC consent-blocks? I assume it is some function which will remove pixels here-and-there (and possibly graying them) and then finally drawing that to screen... I would like to apply it to my application to keep the user from doing anything until the another user connects to the system (but that is besides the point) I would really appreciate the advise. Kind regards A EDIT: i was really