Commit Graph

103 Commits

Author SHA1 Message Date
Mark Johnson 8298025a11 Added pan control for looping sounds
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3981 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-03-25 20:55:55 +00:00
Mark Johnson 5690a38096 Looped sounds were not checking to see if that sound type was enabled
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3980 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-03-25 20:49:22 +00:00
Mark Johnson b7e63c4b38 One more handy constant
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3976 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-03-24 22:25:03 +00:00
Ray Greenwell 02f1aaa904 Fixed bug with setting pan.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3975 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-03-24 22:19:16 +00:00
Ray Greenwell 9f4c7c1ae2 Use setPan() in the SoundKey constructor so that we bound to sanity the
pan value passed to us.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3974 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-03-24 04:12:38 +00:00
Ray Greenwell 6ab61243d9 Allow setting the pan for a sound.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3973 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-03-24 04:01:24 +00:00
Michael Bayne 596d2a4708 blank() -> isBlank().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3749 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-11-09 04:00:16 +00:00
Michael Bayne 1da2e7cc0e Call mark() on the audio input stream because that creates some sort of
push-back buffer that prevents sounds from blarching when we reset the
stream.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3422 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-23 20:57:38 +00:00
Ray Greenwell 8445f3c7f2 Removed extra comma.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3394 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-10 02:13:05 +00:00
Ray Greenwell b07d3821fd Use an LRU cache for our config properties files.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3388 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-09 23:19:01 +00:00
Michael Bayne 44502d01e8 We need to do the property file inheritance processing when loading the
sounds.properties lest we lose the needed info specified in the parent
properties files.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3384 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-07 20:06:55 +00:00
Michael Bayne bc837ca289 The plot thickens. The resource manager prepends "rsrc/" to anything it
loads, but the sound manager wants to load things directly from the
classpath, so we need to allow it to use the classpath that the resource
manager was configured with to ensure that it did the right thing.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3379 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-02 04:35:43 +00:00
Michael Bayne 91f936d147 Need to tack the .properties on by hand when we're loading in this manner.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3378 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-02 04:28:41 +00:00
Michael Bayne f4343be20d Load the sound properties via the ResourceManager which will do the right
classpath magic to work with Game Gardens.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3377 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-02 04:11:51 +00:00
Ray Greenwell ce0db63b27 Added a constructor to not specify a default sound.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3376 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-02 04:10:01 +00:00
Ray Greenwell 9733fc2303 Added support for looping sounds.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3371 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-28 19:29:44 +00:00
Ray Greenwell 10e84f9471 Gee wally, now that sound is fixed, let's go back to expiring late sounds
at a reasonable time again.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3344 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-10 04:00:12 +00:00
Ray Greenwell 5ff24097a7 Tested and verified: the bug is fixed. Removed extra debugging, found
another instance of append() that needed to be changed to appendLoud().


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3343 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-09 23:02:39 +00:00
Ray Greenwell 2ff14aa456 Well then! That last bit of debugging has finally shown me the light!
Queue.append() only does a notify() if the queue was previously empty.
So when the dobj thread was requesting two sounds one after another, it
only woke up one player thread, which played the first sound and then
came back 'round to play the next sound after it was done. The next sound
was usually expired by that time.

Use queue.appendLoud(), which always wakes up a waiter thread.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3342 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-09 22:34:55 +00:00
Ray Greenwell 67521e973d Even more logging, to ensure that two different threads are indeed playing
these two different sounds.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3341 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-09 22:02:22 +00:00
Ray Greenwell 86757cb55e Even more verbose logging to figure out why the sound manager is being so
slow.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3340 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-09 20:59:14 +00:00
Ray Greenwell f027797120 Added some more info to some logging, cleaned up formatting of logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3339 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-09 19:55:31 +00:00
Ray Greenwell 60c5f60a23 Added additional verbose logging to figure out why some clips take
so long to get played.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3338 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-08 07:09:05 +00:00
Ray Greenwell cb6da9d5bc Playing with the sound under windows, it seems that a lot of sounds are
getting dropped because they're taking too long to play. Extended the
max delay to 1000ms, which will surely help more sounds play, but may
not be worth it. Hey, we've got a test server to test on...


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3337 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-08 06:26:27 +00:00
Michael Bayne afabea71ad Big fat Bernie javadoc cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3310 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-24 23:08:21 +00:00
Ray Greenwell 8f40cfa2e3 Be sure to mark all the sound playing threads as daemon.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3305 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-20 00:07:27 +00:00
Ray Greenwell 2b085bd8c2 Finished a weekend project: rewrote the SoundManager.
The SoundManager used to keep the AudioSystem's Line open for up to 30
seconds after a sound was played, maybe because I thought that opening
the line was expensive, or because it makes an audible 'tick' in linux
if no other sounds are playing. Well, it turns out that the sound looping
bug is the result of some internal befuckery of Sun's caused by keeping
the line open. Restructed the sound manager so that lines are opened
every time a sound is to be played and then closed immediately after.

This also allowed me to simplify a thing or two, and sounds should actually
be more responsive, in a tiny way, since previously the dobj thread asked
to play a sound, the sound manager thread would load the clip data and
finally a data spooling thread would play the actual sound. Now there is
no sound manager thread- so the dobj thread adds a sound to the queue and
one of the playing threads wakes up, reads the data and plays the sound.

Factored out all the music stuff into a new MusicManager. There was almost
nothing shared between the two, and it was just annoying to have one
monolithic manager that had all the logic and variables for both of these
distinct functions. The music manager also no longer has a processing
queue, everything takes place on the dobj thread.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3303 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-17 23:30:38 +00:00
Ray Greenwell f9f3d784cf My laptop repeatedly gets the sound looping bug, and I noticed that it goes for about 30 seconds before stopping. We keep the line open for 30 seconds, waiting for another sound, and there must be a bug in the Java libraries that sometimes loops the end of the sound. Expire LineSpoolers after 1 second. If this works I may restructure things so that the threads stay around longer but the lines get closed immediately after the drain delay.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3290 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-29 21:56:58 +00:00
Ray Greenwell bd80c348eb The great Interval revamp.
There is no more SafeInterval, instead Intervals can be constructed with a RunQueue to use for expiring.
PresentsDObjectMgr implements RunQueue.
Client has a getRunQueue() method to get the client side RunQueue.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3283 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-22 19:23:00 +00:00
Michael Bayne 1f8c4578b7 LGPLed the library. Hello world.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3098 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-08-27 02:12:55 +00:00
Michael Bayne 1da753e14d Brought things up to date with the latest Jakarta Commons world order.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3058 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-07-13 16:34:49 +00:00
Ray Greenwell df0cf0cf98 Go back to only logging verbose sound events when the runtime adjust in on.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2975 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-26 18:42:51 +00:00
Michael Bayne d618d3c771 Eclipse suggested cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2971 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-25 14:50:28 +00:00
Ray Greenwell 7ac816f12c - Trashed any reference to line.drain(), we're not going back.
- Removed the RuntimeAdjust for tweaking the Line's buffer size.
- Feed data to the Line in chunks the same size as its buffer.
- Rather than sleeping 3 seconds, calculate how long it would take to play
  the line's entire buffer and sleep that long. It turns out that with
  the buffer size I'm using and the sample rates our sounds are encoded at,
  this is less than 400 ms.
- Went ahead and increased the maximum number of simultaneous line spoolers
  to 12.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2966 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-24 08:08:25 +00:00
Ray Greenwell 3ae08bc60d Never drain(), it's just buggy.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2954 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-12 04:14:21 +00:00
Ray Greenwell ecb6c5a005 Added some logging to track down people who lose sounds after a while
in Windows.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2948 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-04 19:04:46 +00:00
Michael Bayne ddeadbcff1 Let's get jiggy with the verbosity in hopes of shedding some light on this
ever-repeating sound situation.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2926 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-12-22 22:25:34 +00:00
Ray Greenwell 969008a6b8 Added a method for playing sounds after a specified delay.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2826 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-10-16 01:01:51 +00:00
Ray Greenwell 1b9c9dac62 Decreased the maximum number of sound spoolers to 10. What was I smoking
when I set it to 24? Let's try it like this for a spell.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2734 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-07-28 05:32:04 +00:00
Michael Bayne 13ded21e51 Added summarizeState().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2704 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-07-12 03:59:54 +00:00
Ray Greenwell d9e38c1d35 Don't hork if there is a config for a music key, but it's empty.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2647 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-06-07 00:41:25 +00:00
Michael Bayne d4c4596403 Build our new unsafe library (on Linux at least) and some other random
viztool crap that doesn't really matter.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2561 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-09 03:24:12 +00:00
Ray Greenwell 9643db4632 Use RunAnywhere.isLinux() to determine if we should skip draining.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2538 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-03 00:13:04 +00:00
Ray Greenwell 46b8aace97 Don't log a bunch of crap for sounds that are missing during a LOCK
unless verbose logging is turned on.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2392 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-08 20:30:44 +00:00
Ray Greenwell 77633366cc Handle not finding a music player for a song gracefully.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2389 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-08 01:46:16 +00:00
Michael Bayne 8663535d5a Exclude the experimental music players.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2382 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-06 04:36:01 +00:00
Ray Greenwell 728ddcf575 only log that the queue is full (and the full damn contents of the queue)
when verbose logging is on.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2381 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-05 20:48:04 +00:00
Michael Bayne 628bc34eef Make sure we have clips before we try to pick one at random.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2379 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-05 19:00:28 +00:00
Ray Greenwell 02081105c8 cut down on the amount of logging we do for missing sounds
(unless verbose logging is turned on.)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2378 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-05 03:38:41 +00:00
Ray Greenwell 2c4c2d6b92 - only play the default sound for missing sounds if verbose sound event logging
is turned on.
- Expire PLAY requests if they are not processed within 400ms.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2376 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-04 22:34:59 +00:00