Solved it I think :
Code:
procedure PlaySound(const SampleFilename : String);
var mySound : HStream;
begin
// free both MOD and stream, it must be one of them! :)
// BASS_MusicFree(mySound);
// BASS_StreamFree(mySound);
mySound := BASS_StreamCreateFile(FALSE, PChar(SampleFilename), 0, 0, BASS_SAMPLE_FX {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF} or BASS_STREAM_AUTOFREE);
// BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, 4000);
BASS_ChannelPlay(mySound, False);
if BASS_ChannelIsActive(mySound) = 0 then
begin
BASS_ChannelStop(mySound);
BASS_Streamfree(mySound);
end;
end;
BASS_STREAM_AUTOFREE was needed , note though it stops it correctly but it was not freed no idea why....
Thanx
Bookmarks