I can't stand all this DirectSound notification thread WaitForSingleObject nonsense, so the approach I've used is slightly different from the other approaches I saw when researching on the internet.
Streaming from Ogg Vorbis is complicated slightly by the fact that you have no idea how much data is going to be returned from each ov_read(), only the maximum amount. However, my method depends on updating the buffer every quarter second or so for a two second buffer, and it is the space available in the buffer that dictates how much needs to be written.
So I ov_read() into a separate cache, then if there is room in the buffer for all of that data, bung it in and read again.
When there is too much in the cache to fit in the buffer, I put in what will fit, then move the remainder to the front of the cache, storing the size of the data in the cache.
Then, prior to the next ov_read() in the next update, I check to see if there is pending data in the cache and write it to the buffer first if so.
Seems to work okay. When you start playing the data, you can specify how many times you want it to loop (or pass 0 for infinite). It correctly fills the buffer with silence after playing is finished although you do have to stop the buffer manually.
Oh, yeah, by the way sound effects are back in Squishy with facility to load, play and assign them in the editor, so all the above was to get music back in.
I'm sure you hip and trendy cool cats are all using XACT these days, but if anyone could make use of an Ogg and DirectSound8 streaming library, just shout and I'll supply the code.