procedure TfrmOther.btnPlaySoundClick(Sender: TObject);
var
Bs: TStream;
Ms: TMemoryStream;
begin
Bs := dmMain.cdsBlob.CreateBlobStream(dmMain.cdsBlobBinary_Data, bmRead);
try
Ms := TMemoryStream.Create;
try
{Copy the WAV file to memory}
Ms.CopyFrom(Bs, Bs.Size);
{Play it but if we'll have an error, raise exception}
Win32Check(PlaySound(Ms.Memory, 0, SND_SYNC or SND_MEMORY));
finally
Ms.Free
end;
finally
Bs.Free
end;
end;