But the sound does not play. If use FSOUND_Sample_Load and load from a file it works fine. Can anyone see whare I have gone wrong? Or alternatively does anyone have a small demo using TMemoryStream that I could look over.

It works fine using a TMemoryStream as the source. Make sure the contents of the memory stream is correct. Try this code for a test…
<pre>
Stream := TMemoryStream.Create;
try
Stream.LoadFromFile(dlgOpenWav.FileName);
FSample := FSOUND_Sample_Load(FSOUND_FREE, PChar(Stream.Memory), FSOUND_NORMAL or FSOUND_LOADMEMORY, Stream.Size);
finally
Stream.Free;
end;
if FSample <> nil then
FSOUND_PlaySound(FSOUND_FREE, FSample);
</pre>

I have nearly the same problem.
I used FMUSIC_LoadSongMemory
for a long time successfull. Then
I tried to load a mp3 file with
FSOUND_Stream_OpenFile also from
memory but it does not work correct.
There is a screeezzze sound when it
starts to play and then its like if
the music is forwarded and the song
strarts nearly at the end of the music track. But then he plays with normal speed.
Don’t know what’s wrong with that function cause when I load the song without the parameter (to load it from memory) it works fine. It’s only when I load it from memory ?!