View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide

MP3 reader

Andree Jacobson had an idea how to read MP3's into a set of samples. BookClasses-v8.jar


Ok, I know I said winter break, but I was so close to getting done anyway, so I hacked it up over the last two days.
Attached is a jar file containing all the necessary libraries, and the files from your src zip since July 22. As the subject
line says, most of the updates are the in those classes. If you put this jar file on the build path, you should be able to
get access to all the classes from your book by

import bookClasses.;

now, try to open an mp3 song.

public static void main ( String[] args ) {
Sound s = new Sound ( "mySong.mp3" );
s.explore();
}

and it should work. Even though I have it packaged in a jar file it should still work in your distribution as well.
The main thing are some updates to the mp3spi jar file that I did. It's also embedded in the jar file along with
the javazoom libraries. I have removed the sound.jar file that was in there with your distribution as the files
in that file were conflicting with my jvm sound files, and they should be included in the standard jre anyway.
Also, there are some comments in the three class files above. Another major change I did was that I removed
a busy-wait loop present in SimpleSound's playAtRateInRange method, and replaced those with Thread
wait/notify instead. When my students ran the code containing a busy wait, the program would get stuck in that
loop, causing quite some confusion. It would also hang the sound explorer if we tried to play anything else than
the whole song. It is possible that this is because my students get your files as a jar, and all their methods take
Sound objects as parameters instead of accessing the sound data by "this".

Anyway, let me know if you have any problems with it, or questions.


Link to this Page