Вопрос

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

Это было полезно?

Решение

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)

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top