Reputation: 739
I am trying to use the BASS library to do some audio editing, so if anyone is familiar with the library can hopefully help me.
The function I'm using is
Bass.BASS_StreamCreateFile(filename, offset, length, flags);
For a little background, I'm using Bass.net wrapper, am working with all mp3 files. The actual code I'm using this function with is:
int baseStream = Bass.BASS_StreamCreateFile(filename, startTimeBytes, durationBaseBytes, BASSFlag.BASS_STREAM_PRESCAN | BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_SAMPLE_FLOAT);
Whenever the offset (startTimeBytes) equals 0, the stream is created just fine, but whenever the offset is non-zero, the method returns 0, and the error code given is BASS_ERROR_FILEFORM. However, the files used work fine without the offset (offset = 0).
Maybe there is something wrong with the flags I'm using or something?
Upvotes: 1
Views: 1000
Reputation: 3549
Your mp3 files contain frames without offset. So use 0
offset.
To set the playback position of a stream use BASS_ChannelSetPosition().
BASS_POS_BYTE
mode.Upvotes: 1