I'm now developing a software that playing flac and mp3 file over the internet. My software have an option that allow user can convert flac to mp3 and play that mp3. So I decide to use BASS_StreamCreateFileUser like this:
public static void Play(object state)
BASS_FILEPROCS fileProcs = new BASS_FILEPROCS(null, null, new FILEREADPROC(FileReadProc), null);
int stream = Bass.BASS_StreamCreateFileUser(BASSStreamSystem.STREAMFILE_BUFFERPUSH,
BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_STREAM_PRESCAN, fileProcs, IntPtr.Zero);
Uri url = new Uri(state.ToString());
playback = new Playback();
but I get an error: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." when I try to call BASS_StreamCreateFileUser.
I don't understand
. Could anyone help me about this?
Thank a lot.