NS_PRIORITY_NORMAL, NS_TYPE_REPEATING_PRECISE);
PR_TRUE, NS_TYPE_REPEATING_PRECISE);
nsSystemSoundRequest::PlaySound(){  NS_ASSERTION(mSndChannel && mSoundHandle, "Should have sound channel here");  if (!mSndChannel || !mSoundHandle) {    Cleanup();    return NS_ERROR_NOT_INITIALIZED;  }    nsresult rv;  // set up a timer. This is used to sniff for mSoundDone (which is set by the channel callback).  mTimer = do_CreateInstance("@mozilla.org/timer;1", &rv);    // release previous timer, if any  if (NS_FAILED(rv)) {    Cleanup();    return rv;  }  OSErr err = ::SndPlay(mSndChannel, (SndListHandle)mSoundHandle, true /* async */);  if (err != noErr) {     Cleanup();     return NS_ERROR_FAILURE;  }  // now queue up a sound completion command so we get a callback when  // the sound is done.  SndCommand    theCmd = { callBackCmd, 0, 0 };  theCmd.param2 = (long)this;    err = ::SndDoCommand(mSndChannel, &theCmd, false);   // wait for the channel  if (err != noErr) {    Cleanup();    return NS_ERROR_FAILURE;  }    const PRInt32   kSoundTimerInterval = 250;      // 250 milliseconds  rv = mTimer->Init(NS_STATIC_CAST(nsITimerCallback*, this), kSoundTimerInterval,          NS_PRIORITY_NORMAL, NS_TYPE_REPEATING_PRECISE);  if (NS_FAILED(rv)) {    Cleanup();    return rv;  }  return NS_OK;}