I am looking at putting in Fmod into Visual Pinball as it seems a very nice sound library.
I have a question about open stream when the non blocking flag is set. the documentation mentions that you should poll the stream but I’m unsure about what function to use for that as most of the functions require a channel refernece and since the file isn’t open yet, the play command fails and thus you have no channel to poll..
I’m using streams so I can read songs from either disk or from istorage/istream containers (which works very well)..
another quick question about FSOUND_SetLoopMode. this changes the loop mode after the song has started playing so I can check to see if a song has repeated (the best was I can see is to poll the channel and check to see if the stream pointers have reset (ie its reading from the beginning of the file again) and turn off the loop mode (if I want to say play a song n times..)
co-developer of Visual Pinball.
Well I don’t know about the looping functions, but you could just go about doing it a different way. Instead of polling to see if it has reset to the start, have it poll it to see if it has finished playing. Then, if it has, just play it again. Repeat for the number of times you wish the song to be played.
Of corse that might not work depending on how often you poll it, because there may be a gap between the end and the begining again, but if you poll it frequiently, it should work.
can a pose another question
I am starting a repeating stream (by using FSOUND_LOOP_NORMAL) in FSOUND_Stream_PlayEx and am checking for the play position reseting back to the begining of the song (via FSOUND_Stream_GetPosition() )
. when this happens I am trying to turn off the looping for the channel playing the stream.. ( FSOUND_SetLoopMode(channel, FSOUND_LOOP_OFF) but the sound disappears at that point and the stream dosn’t play again..
Please login first to submit.