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
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: SoundManager.java,v 1.67 2003/12/22 22:25:34 mdb Exp $
|
// $Id: SoundManager.java,v 1.68 2004/02/04 19:04:46 ray Exp $
|
||||||
|
|
||||||
package com.threerings.media.sound;
|
package com.threerings.media.sound;
|
||||||
|
|
||||||
@@ -382,7 +382,7 @@ public class SoundManager
|
|||||||
synchronized (_queue) {
|
synchronized (_queue) {
|
||||||
if (_queue.size() < MAX_QUEUE_SIZE) {
|
if (_queue.size() < MAX_QUEUE_SIZE) {
|
||||||
// if (_verbose.getValue()) {
|
// if (_verbose.getValue()) {
|
||||||
Log.info("Sound request [key=" + skey + "].");
|
Log.info("Sound request [key=" + skey.key + "].");
|
||||||
// }
|
// }
|
||||||
_queue.append(PLAY);
|
_queue.append(PLAY);
|
||||||
_queue.append(skey);
|
_queue.append(skey);
|
||||||
@@ -437,6 +437,9 @@ public class SoundManager
|
|||||||
protected void playSound (SoundKey key)
|
protected void playSound (SoundKey key)
|
||||||
{
|
{
|
||||||
if (key.isExpired()) {
|
if (key.isExpired()) {
|
||||||
|
// if (_verbose.getValue()) {
|
||||||
|
Log.info("Sound expired [key=" + key.key + "].");
|
||||||
|
// }
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -451,6 +454,7 @@ public class SoundManager
|
|||||||
new ByteArrayInputStream(data));
|
new ByteArrayInputStream(data));
|
||||||
|
|
||||||
LineSpooler.play(stream, _clipVol, key);
|
LineSpooler.play(stream, _clipVol, key);
|
||||||
|
_soundSeemsToWork = true;
|
||||||
|
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
Log.warning("Error loading sound file [key=" + key +
|
Log.warning("Error loading sound file [key=" + key +
|
||||||
@@ -461,11 +465,16 @@ public class SoundManager
|
|||||||
", e=" + uafe + "].");
|
", e=" + uafe + "].");
|
||||||
|
|
||||||
} catch (LineUnavailableException lue) {
|
} catch (LineUnavailableException lue) {
|
||||||
// this error comes every goddamned time we play a sound on
|
String err = "Line not available to play sound [key=" + key.key +
|
||||||
// someone with a misconfigured sound card, so let's just keep
|
", e=" + lue + "].";
|
||||||
// it to ourselves
|
if (_soundSeemsToWork) {
|
||||||
Log.debug("Line not available to play sound [key=" + key +
|
Log.warning(err);
|
||||||
", e=" + lue + "].");
|
} else {
|
||||||
|
// this error comes every goddamned time we play a sound on
|
||||||
|
// someone with a misconfigured sound card, so let's just keep
|
||||||
|
// it to ourselves
|
||||||
|
Log.debug(err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1217,6 +1226,9 @@ public class SoundManager
|
|||||||
/** The queue of sound clips to be played. */
|
/** The queue of sound clips to be played. */
|
||||||
protected Queue _queue = new Queue();
|
protected Queue _queue = new Queue();
|
||||||
|
|
||||||
|
/** If we every play a sound successfully, this is set to true. */
|
||||||
|
protected boolean _soundSeemsToWork = false;
|
||||||
|
|
||||||
/** An interval that plays sounds later. */
|
/** An interval that plays sounds later. */
|
||||||
protected Interval _playLater = new Interval() {
|
protected Interval _playLater = new Interval() {
|
||||||
public void intervalExpired (int id, Object rock) {
|
public void intervalExpired (int id, Object rock) {
|
||||||
|
|||||||
Reference in New Issue
Block a user