jlayer

Is it possible to know the duration of an MP3 before the entire file is downloaded?

血红的双手。 提交于 2019-12-23 20:43:26
问题 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 = AudioSystem.getAudioFileFormat(source); Long microseconds = (Long) fileFormat.properties().get("duration"); System.out.println(microseconds); However when I take the similar code and the very same MP3 and change the source to a URL, JLayer does not

Set of questions related to playing sound / video in java

微笑、不失礼 提交于 2019-12-23 04:40:42
问题 There are some set of questions i wanted to ask related to Java Sound which are as follows : Can i use xuggler with netbeans ? If yes can anyone please tell the way out ? What are the audio and video formats xuggler is able to decode Is xuggler the best open source library to play audio and video in java ? Is JLayer a good library to play audio files ? Can i use JLayer to play video files ? I want my program to play mp3,wav,mp4,3gp files (commonly used) which is the best library to use ? 回答1:

Zooming JLayeredPane via JLayer and the LayerUI

假如想象 提交于 2019-12-17 16:55:11
问题 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

LineUnavailableException for playing mp3 with java

笑着哭i 提交于 2019-12-17 16:52:09
问题 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 URL("http://localhost:8080/agriserver/facebook/sound/test6.mp3")); Clip clip = AudioSystem.getClip(info); clip.open(inputStream); clip.start(); Failed attempts to fix it: Use Sun's mp3 plugin. Use Jlayer 3rd party library Use Tritonus 3rd party library Re-encode the mp3 with Sony Sound Forge, Adobe Sound

Component layering Java Swing, Layers showing on hover

[亡魂溺海] 提交于 2019-12-14 02:07:32
问题 I have two JPanels layered on top of each other in the same container. I am using container.add(jpanel,0); and container.add(otherjpanel, 1). It works fine however in order for the top layer to show I have to hover over the components with the mouse. Here is some executable code showing my problem. Just hover mouse on upper part of screen. import java.awt.*; import java.awt.event.*; import java.awt.image.BufferedImage; import javax.swing.event.*; import javax.swing.*; import javax.swing.text.

Conflicting Jar Methods

谁说我不能喝 提交于 2019-12-13 08:12:21
问题 I have been trying to make my first GUI music player in Java. So far I have been able to play MP3 with Javasound and MP3SPI. Now, I want to support .m4a songs and from what I have researched the best library to do this is JAAD. I downloaded it, added it to my project and it worked perfectly when I tried to play a .m4a song. The problem happens when I try to play an .mp3 after adding the JAAD library. My code for playing songs is: File file = new File(pathToSong); AudioInputStream audioStream=

Android - MP3 JLayer missing data

余生长醉 提交于 2019-12-13 03:23:23
问题 I have a server that encodes real-time voice into mono or stereo mp3 thanks to libmp3lame and sends it chunk by chunk through a WebSocket. I'm trying to make an Android App that receives those mp3 chunks and play them with the most appropriate Audio player Android have. I went with AudioTrack since it seems pretty easy to add chunks to the player as well as "stream" oriented. (Since what I'm doing is sending to the track some byte array and not a full song that is locally stocked in the

Multiple JPanels completely on top of each other

懵懂的女人 提交于 2019-12-12 12:12:01
问题 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 multiple jpanels completely on top of each other and making them all able to draw. 回答1: The basic approach to this problem would be to use a JLayeredPane and something like GridBagLayout . The JLayeredPane will give you some better control over the z

Problems using javazoom's Player

最后都变了- 提交于 2019-12-11 10:46:30
问题 I'm trying to play mp3-files using the JLayer Class Player. After starting the Thread containing myPlayer.play() you can hear some hundred milliseconds of the beginning of the song and then the player interrupts and I get the following error messages: > javazoom.jl.decoder.BitstreamException: Bitstream errorcode 102 at > javazoom.jl.decoder.Bitstream.newBitstreamException(Unknown Source) > at javazoom.jl.decoder.Bitstream.readFrame(Unknown Source) at > javazoom.jl.player.Player.decodeFrame

How to make a JFrame blurred in java?

ε祈祈猫儿з 提交于 2019-12-11 05:51:14
问题 In my java program, when the user clicks on a button in the main JFrame another JFrame becomes visible on top of the main frame. Now how to make the previous frame blurred? Exactly like the background in the image : 回答1: Now how to make the previous frame blurred? have look at JLayer(Java7) based on JXLayer(Java6), similair effect is possible with GlassPane, or with JViewport (not proper of ways, but good Swing GUI contains JScrollPane as 1st. JComponent in JFrame / JDialog / JWindow ) 回答2: I