--- sound.cpp	Wed Aug 13 14:01:01 2003
+++ sound.cpp.2	Wed Aug 13 14:19:56 2003
@@ -492,23 +492,22 @@
 		return;
 	}
 	
-	if ((_scumm->_features & GF_AMIGA) && (_scumm->_version == 3))
-	{
-		// experimental support for Indy3 Amiga sound effects
-		if (READ_BE_UINT16(ptr + 26) == 0x00FF)		// looped sound
-			// TODO: support looping sounds
-			// ptr + 14 seems to be looping duration
-			flags = 0;
-		else if (READ_BE_UINT16(ptr + 26) == 0x0001)	// nonlooped sound
-			flags = 0;	// 
-		else if (READ_BE_UINT16(ptr + 26) == 0x0101)	// background music
-			// TODO: support music
+	if ((_scumm->_features & GF_AMIGA) && (_scumm->_version == 3)) {
+		if (READ_BE_UINT16(ptr + 26) & 0x0100) {
+			// TODO: support Amiga music
 			return;
+		}
 		size = READ_BE_UINT16(ptr + 12);
 		rate = 11000;
 		sound = (char *)malloc(size);
-		memcpy(sound,ptr + 28,size);
-		_scumm->_mixer->playRaw(NULL, sound, size, rate, SoundMixer::FLAG_AUTOFREE, soundID);
+		memcpy(sound,ptr + READ_BE_UINT16(ptr + 8),size);
+		if (READ_BE_UINT16(ptr + 16) || READ_BE_UINT16(ptr + 6)) {
+			// the first check is for pitch-bending looped sounds (i.e. "pouring liquid", "biplane dive", etc.)
+			// the second check is for simple looped sounds
+			_scumm->_mixer->playRaw(NULL,sound,size,rate,SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_LOOP,soundID,READ_BE_UINT16(ptr + 10) - READ_BE_UINT16(ptr + 8),READ_BE_UINT16(ptr + 14));
+		} else {
+			_scumm->_mixer->playRaw(NULL,sound,size,rate,SoundMixer::FLAG_AUTOFREE,soundID);
+		}
 		return;
 	}
 
@@ -802,7 +801,10 @@
 		_scumm->_imuse->stopSound(a);
 	} else if (_scumm->_playerV2) {
 		_scumm->_playerV2->stopSound (a);
-	} 
+	} else if ((_scumm->_features & GF_AMIGA) && (_scumm->_version == 3)) {
+		// this handles stopping looped sounds for now
+		_scumm->_mixer->stopID(a);
+	}
 
 	for (i = 0; i < 10; i++)
 		if (_soundQue2[i] == a)
