Okay, I've tried what you suggested, I started a decoder channel
_decoder = BASS_StreamCreateFileUser(STREAMFILE_NOBUFFER, BASS_STREAM_DECODE, &decoderFileProcs, NULL)
and a playing channel
_channel = BASS_StreamCreate(ci.freq, ci.chans, ci.flags&(BASS_SAMPLE_FLOAT|BASS_SAMPLE_8BITS), STREAMPROC_PUSH, 0)
and then I am feeding the playing channel in a separate thread
DWORD c = BASS_ChannelGetData(_decoder, buf, sizeof(buf)); // request data from the decoder
if (c==-1) break; // error, eg. EOF or freed
c = BASS_StreamPutData(_channel, buf, c); // feed the data to the push stream
if (c) usleep(100000); // queued data means the playback buffer is full, so wait a bit (100ms)
but it still works just for mp3 files.
If I try mp4 aac files or even lpcm, it just returns BASS_ERROR_FILEFORM.
I thought at least LPCM should work but it doesn't :/
Do you have any other ideas?
I really don't want to ditch BASS for playing filetypes other than mp3...
Also, what I've tried and doesn't work with mp4 files
NSString *fullPath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:fileName];
NSData *data = [[NSData alloc] initWithContentsOfFile:fullPath];
NSData *subData = [data subdataWithRange:NSMakeRange(0, data.length / 2)];
but it works perfect when the data provided is whole,
So basically, it comes to having to provide the whole file data in order to play the mp4 file,
which is not acceptable for my app. Imagine loading a 280 minute podcast here