Got the sound manager test app mostly working again.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2051 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-12-10 21:36:53 +00:00
parent a2c3741b2b
commit 64ab1e11ae
2 changed files with 24 additions and 6 deletions
@@ -1,5 +1,5 @@
// //
// $Id: SoundTestApp.java,v 1.2 2002/11/12 22:55:59 shaper Exp $ // $Id: SoundTestApp.java,v 1.3 2002/12/10 21:36:53 mdb Exp $
package com.threerings.media; package com.threerings.media;
@@ -13,20 +13,31 @@ public class SoundTestApp
{ {
if (args.length == 0) { if (args.length == 0) {
Log.info("Usage: runjava com.threerings.media.SoundTestApp " + Log.info("Usage: runjava com.threerings.media.SoundTestApp " +
"<file1> [<file2> <file3> ...]"); "<key1> [<key2> <key3> ...]");
System.exit(0); System.exit(0);
} }
ResourceManager rmgr = new ResourceManager("rsrc"); ResourceManager rmgr = new ResourceManager("rsrc");
_soundmgr = new SoundManager(rmgr); _soundmgr = new SoundManager(rmgr);
_files = args; _keys = args;
} }
public void run () public void run ()
{ {
for (int ii = 0; ii < _files.length; ii++) { for (int ii = 0; ii < _keys.length; ii++) {
_soundmgr.play(SoundManager.DEFAULT, _files[ii]); System.out.println("Playing " + _keys[ii] + ".");
_soundmgr.play(SoundManager.DEFAULT,
"com/threerings/media/", _keys[ii]);
} }
_soundmgr.shutdown();
// the sound manager starts up threads that never seem to exit so
// we have to stick a fork in things after a short while
try {
Thread.sleep(5000L);
} catch (InterruptedException ie) {
}
System.exit(0);
} }
public static void main (String[] args) public static void main (String[] args)
@@ -35,6 +46,6 @@ public class SoundTestApp
app.run(); app.run();
} }
protected String[] _files; protected String[] _keys;
protected SoundManager _soundmgr; protected SoundManager _soundmgr;
} }
@@ -0,0 +1,7 @@
#
# $Id: sounds.properties,v 1.1 2002/12/10 21:36:53 mdb Exp $
#
# Sound test app configuration file
sound1 = media/test.wav
sound2 = foo/bar.wav