void nsSpeechTask::Cancel() { MOZ_ASSERT(XRE_IsParentProcess()); LOG(LogLevel::Debug, ("nsSpeechTask::Cancel")); if (mCallback) { DebugOnly<nsresult> rv = mCallback->OnCancel(); NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "Unable to call onCancel() callback"); } if (mStream) { mStream->Suspend(); } if (!mInited) { mPreCanceled = true; } if (!mIndirectAudio) { DispatchEndInner(GetCurrentTime(), GetCurrentCharOffset()); } }
NS_IMETHODIMP nsSpeechTask::DispatchEnd(float aElapsedTime, uint32_t aCharIndex) { if (!mIndirectAudio) { NS_WARNING("Can't call DispatchEnd() from a direct audio speech service"); return NS_ERROR_FAILURE; } return DispatchEndInner(aElapsedTime, aCharIndex); }
void nsSpeechTask::ForceEnd() { if (mStream) { mStream->Suspend(); } if (!mInited) { mPreCanceled = true; } DispatchEndInner(GetCurrentTime(), GetCurrentCharOffset()); }
void nsSpeechTask::ForceEnd() { if (mStream) { mStream->ChangeExplicitBlockerCount(1); } if (!mInited) { mPreCanceled = true; } DispatchEndInner(GetCurrentTime(), GetCurrentCharOffset()); }