Pergunta

I am working on a program in Java to play a song and at certain points in the song send a trigger over serial to a microprocessor. I have the microprocessor/serial port working without a problem but I have no idea where to go with playing the song.

I have looked into JMF, java.applet.AudioClip, and BigClip but I don't know which one is the easiest. Also, I would like to be able to get the duration of the song (and display the time played) and it doesn't look like java.applet.AudioClip can handle that. Lastly, I am having trouble with a heap overflow grabbing the music file (~40MB).

So, how do I create a basic music player that can start, pause, resume (if possible to specify point in song in seconds), and stop?

Thanks

Foi útil?

Solução

It might be worth looking at http://docs.oracle.com/javase/7/docs/api/javax/sound/sampled/Clip.html

There's a method in there which might help: setFramePosition(int frames)

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top