From bad6ec838876bd88e3638bd07ad6e7d12c9af727 Mon Sep 17 00:00:00 2001
From: Paul Gilbert <dreammaster@scummvm.org>
Date: Thu, 23 Aug 2012 22:01:52 +1000
Subject: [PATCH] TONY: Fixed problem with spoken voices being clipped when
 timed text mode is on.

---
 engines/tony/sound.cpp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/engines/tony/sound.cpp b/engines/tony/sound.cpp
index 781172df529..87e142df487 100644
--- a/engines/tony/sound.cpp
+++ b/engines/tony/sound.cpp
@@ -132,7 +132,7 @@ FPSfx::FPSfx(bool bSoundOn) {
 	_bSoundSupported = bSoundOn;
 	_bFileLoaded = false;
 	_lastVolume = 63;
-	_hEndOfBuffer = CORO_INVALID_PID_VALUE;
+	_hEndOfBuffer = CoroScheduler.createEvent(true, false);
 	_bIsVoice = false;
 	_loopStream = 0;
 	_rewindableStream = 0;
@@ -161,9 +161,8 @@ FPSfx::~FPSfx() {
 	else
 		delete _rewindableStream;
 
-	// FIXME
-	//if (hEndOfBuffer != CORO_INVALID_PID_VALUE)
-	//	CloseHandle(hEndOfBuffer);
+	// Free the buffer end event
+	CoroScheduler.closeEvent(_hEndOfBuffer);
 }
 
 /**