my app downloads an MP3 from a server and starts playing while it’s still writing to the file on Windows Mobile 5. I used a different MP3 player before which could handle this (but had other problems), but it doesn’t seem to work with fmodce.
FSOUND_Stream_Open gives me error code 9 (file not found?), which is not true, since the file IS there. Is fmod requiring exclusive access to a file?
Is it possible to do this without changing my code too much? Can I stream the data to fmod in some other way? Via memory, maybe?
Thanks in advance for any help.
I tried opening the file with NONBLOCKING and queried the state with GetOpenState(). It stays at -2 (still opening) for a bit, but when I try to play the stream GetOpenState() returns -3 (stream failed to open).
It seems that fmod is not able to play a file while it is being written to, correct?
Does FSOUND_Stream_Create() work with MP3s? Can I just pass the mp3 encoded data to the callback? (Help isn’t too clear about this, just says something about SIGNED RAW data, which doesn’t mean much to me, sorry).
- CAMongrel asked 12 years ago
its probably something to do with the file being exclusively locked if you’re still writing to it. You’ll have to fix that on your end. Also if the size of the file is changing constantly that wont work either, fmod will determine the size of the mp3 when it first opens it.
The file is opened in shared mode (otherwise it wouldn’t work with the other mp3 player either).
Here’s how I’m writing to the file:
Create the file in full length and fill it with zeros, then overwrite the zeros with the incoming data. I’m waiting until at least 50 kb have been received, then I start to play.
- CAMongrel answered 12 years ago
Please login first to submit.