| 1 |
The classes for the Java Sound demo are contained in the JavaSoundDemo.jar |
|---|
| 2 |
file. Running the demo requires the Java 2 SDK, Standard Edition 1.3. |
|---|
| 3 |
To run the Java Sound demo : |
|---|
| 4 |
|
|---|
| 5 |
% java -jar JavaSoundDemo.jar |
|---|
| 6 |
|
|---|
| 7 |
Although it's not necessary to unpack the JavaSoundDemo.jar file to run |
|---|
| 8 |
the demo, you may want to extract its contents if you plan to modify |
|---|
| 9 |
any of the demo source code. To extract the contents of JavaSoundDemo.jar, |
|---|
| 10 |
run this command from the JavaSound directory : |
|---|
| 11 |
|
|---|
| 12 |
jar xvf JavaSoundDemo.jar |
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
This JavaSound demo consists of a set of demos housed in one GUI |
|---|
| 16 |
framework that uses a JTabbedPane. You can access different groups of |
|---|
| 17 |
demos by clicking the tabs at the top of the pane. There are demo |
|---|
| 18 |
groups for Juke Box, Capture & Playback, Midi Synthesizer and Rhythm |
|---|
| 19 |
Groove Box. |
|---|
| 20 |
|
|---|
| 21 |
Juke Box : |
|---|
| 22 |
|
|---|
| 23 |
A Juke Box for sampled (au, wav, aif) and midi (rmf, midi) sound |
|---|
| 24 |
files. Features duration progress, seek slider, pan and volume |
|---|
| 25 |
controls. |
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
Capture & Playback : |
|---|
| 29 |
|
|---|
| 30 |
A Capture/Playback sample. Record audio in different formats |
|---|
| 31 |
and then playback the recorded audio. The captured audio can |
|---|
| 32 |
be saved either as a WAVE, AU or AIFF. Or load an audio file |
|---|
| 33 |
for streaming playback. |
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
Midi Synthesizer : |
|---|
| 37 |
|
|---|
| 38 |
Illustrates general MIDI melody instruments and MIDI controllers. |
|---|
| 39 |
A piano keyboard represents notes on and off. Features capture |
|---|
| 40 |
and playback of note on and off events. |
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
Rhythm Groove Box : |
|---|
| 44 |
|
|---|
| 45 |
Illustrates how to build a track of short events. Features |
|---|
| 46 |
a tempo dial to increase or descrease the beats per minute. |
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
You can run anyone of the samples in stand-alone mode by issuing a |
|---|
| 50 |
commands like this from the JavaSound directory: |
|---|
| 51 |
|
|---|
| 52 |
java -cp JavaSoundDemo.jar Juke |
|---|
| 53 |
java -cp JavaSoundDemo.jar CapturePlayback |
|---|
| 54 |
java -cp JavaSoundDemo.jar MidiSynth |
|---|
| 55 |
java -cp JavaSoundDemo.jar Groove |
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 |
When running the Java Sound demo as an applet these permissions |
|---|
| 59 |
are necessary in order to load/save files and record audio : |
|---|
| 60 |
|
|---|
| 61 |
grant { |
|---|
| 62 |
permission java.io.FilePermission "<<ALL FILES>>", "read, write"; |
|---|
| 63 |
permission javax.sound.sampled.AudioPermission "record"; |
|---|
| 64 |
permission java.util.PropertyPermission "user.dir", "read"; |
|---|
| 65 |
}; |
|---|
| 66 |
|
|---|
| 67 |
The permissions need to be added to the .java.policy file. |
|---|
| 68 |
|
|---|
| 69 |
====================================================================== |
|---|
| 70 |
|
|---|
| 71 |
You may send comments via the javasound-comments@sun.com alias, |
|---|
| 72 |
which is a one-way alias to Sun's Java Sound API developers, or via the |
|---|
| 73 |
javasound-interest@sun.com alias, which is a public discussion list. |
|---|