Processing audio output so as to create a Visualization

I would like to know how we can grab audio output details so that we could Create a Visualization (for example).
[133 byte] By [meetsreekanth] at [2007-9-26 12:58:15]
# 1

You can use the javax.sound.sampled package for this. To load an audio file, do this:

AudioInputStream audioStream = AudioSystem.getAudioInputStream(audioFile);

Mixer.Info[] mixers = AudioSystem.getMixerInfo();

Mixer mixer = AudioSystem.getMixer(mixers[mixers.length - 1]); //or something...

AudioFormat format = audioStream.getFormat();

byte[] audio = new byte[audioStream.available()];

audioStream.read(audio);

Now you have a buffer containing the bytes for the audio file. This consists of a couple of thousand elements, so it can be hard to grasp the meaning of the values. What you need to do is locate peeks in this byte code.

nille40 at 2007-7-2 12:44:31 > top of Java-index,Security,Cryptography...
# 2
The solution works fine for simple audio formats supported by javax.sound.sampled but i need it for coded formats such as MP3
meetsreekanth at 2007-7-2 12:44:31 > top of Java-index,Security,Cryptography...
# 3
I also have this problem. I want to draw the waveform of an audio file that I load via JMF this is often a MP3. I tried building a custom datasink, but it seems only to get the data very slowly (maybe realtime). Is there a better way to do this?
sparkyb at 2007-7-2 12:44:31 > top of Java-index,Security,Cryptography...
# 4

> I also have this problem. I want to draw the waveform

> of an audio file that I load via JMF this is often a

> MP3. I tried building a custom datasink, but it seems

> only to get the data very slowly (maybe realtime). Is

> there a better way to do this?

I tried another soloution, i wrote a Effect plugin to the Processor, In the effect i pushed the array of bytes to my visual component, it works, but it gives me to big array of data.

colan at 2007-7-2 12:44:31 > top of Java-index,Security,Cryptography...
# 5

Hi,

i d like to know how to modify each channel of the stereo signal (left and right channel) separately using jmf.

I wanna write a pan effect filter just for education and then go on with the real project.

I wanna write it as a effect plugin.

You can also reply directly to

christ_o@gmx.de

Thanks a lot,

Olaf Christ

Christ_o at 2007-7-2 12:44:31 > top of Java-index,Security,Cryptography...
# 6
Anyone mind to show me the codes for creating a visualizer .i'm having some problem with the codes that is posted .
Choonghau at 2007-7-2 12:44:31 > top of Java-index,Security,Cryptography...
# 7
Hi,I'm also trying to visualize MP3 files but i have no luck. Can someone post the code to get the byte[] of the MP3 File?Many thanx in advance,Joe
check-mate at 2007-7-2 12:44:31 > top of Java-index,Security,Cryptography...