Still can't get the sound to be perfect. The link below includes the source and exe.
In Helios_ROQ_Engine.pas uncommenting the define at the top ({//$DEFINE ROQ_SOUND_1}) turns on the experimental sound. Which should (i think.. tho it doesn't) work perfectly..... Basicaly when its enabled when new sound is read from the frame its shoved into the audiobuffer and reuploaded to fmod. all of the sound that hasn't been played in the current buffer is moved to the new buffers start, then the new sound is added afterwards.
Code: Procedure BuildAudioBuffer(BytesRead,CurAudioBufferLength : Integer; var Cinematic : PCinematic); var BytesRemaining,ByteCount : Integer; begin ByteCount := CurAudioBufferLength-BytesRead; Move(Cinematic.AudioBuffer2[BytesRead],AudioBuffer[0],ByteCount); BytesRemaining := Min(65536,Cinematic.AudioSampleOffset); Move(Cinematic.AudioBuffer[0],AudioBuffer[ByteCount],BytesRemaining); end; {$IfDef ROQ_SOUND_1} BytesRead := (FSOUND_GetCurrentPosition(Cinematic.FmodEmitterID)); If (Cinematic.CurAudioBufferLength-BytesRead > 0) and (BytesRead > 0) then begin FillChar(AudioBuffer[0], Cinematic.AudioSampleCount * SizeOf(SmallInt), 0); BuildAudioBuffer(BytesRead,Cinematic.CurAudioBufferLength,Cinematic); FSOUND_Sample_Upload(Sound.FEmitters[Cinematic.FmodEmitterID].SamplePtr,@AudioBuffer[0],FSOUND_SIGNED); end else {$EndIf}
- Helios Roq 26/7/2005 (700kb approx)
|