I’m very new to FMOD, and still figuring things out, but I’m just trying a simple project, of streaming an MP3 file from the internet, like http://www.mysite.com/mymp3file.mp3.
I’m trying to get a hang of things using the netstream example, but every mp3 I try to stream I get this error.
Couldn’t perform seek operation. This is a limitation of the medium (ie netstreams) or the file format.
That error is the result of this line
result = system->createSound(argv, FMOD_HARDWARE | FMOD_2D | FMOD_CREATESTREAM | FMOD_NONBLOCKING, 0, &sound);
I have tried with various files, I guess I don’t really understand what this error message means, and why I’m getting it. I’m just trying to play the file, not do any seeking? If this is not the way to stream a simple file, what is the way?
Any help or pointers would be great.
- KyleGobel asked 7 years ago
The netstream is simply a socket connection to a website, all we do is read from the socket and data comes into our buffers. If the seek destination is within the buffer it’s okay, but once data has been read and discarded we cannot go back (or seek the socket), we would need to reopen the stream and read through the (potentially different) data to the desired position. The concept of seeking a netstream is like trying to fast forward or rewind radio.
The file will contain large tag data, FMOD is happy to read over that stuff but for the MPEG codec to work it needs to do some small seeks. Since you cannot seek a netstream all the seeks must be contained inside the low level file buffer. If you tweak the file buffer size, make it a bit larger you can overcome this restriction. See System::setFileSystem "blockalign" parameter.
Please login first to submit.