Author: Tomas Rutkauskas How do I play an audio waveform from a memory buffer without writing to disk? Answer: 1 procedure TFrmWaves.PlayTheSound(AName: PChar); 2 var 3 resInfo: THandle; 4 wavHdl: THandle; 5 wavPtr: Pointer; 6 begin 7 case RgrMethod.ItemIndex of 8 0: 9 begin 10 resInfo := FindResource(HInstance, AName, RES_TYPE); 11 if resInfo <> 0 then 12 begin 13 Label1.Caption := StrPas(AName); 14 wavHdl := LoadResource(HInstance, resInfo); 15 wavPtr := LockResource(wavHdl); 16 sndPlaySound(wavPtr, SND_ASYNC or SND_MEMORY); 17 if (wavHdl <> 0) then 18 begin 19 UnlockResource(wavHdl); 20 FreeResource(wavHdl); 21 end; 22 end 23 else 24 Label1.Caption := StrPas(AName) + ': Not found'; 25 end; 26 1: PlaySound(AName, HInstance, SND_RESOURCE); 27 end; 28 end;