Regarding "downloading" network files to memory, you could use BASS_StreamCreateFileUser and the "buffered" file system (STREAMFILE_BUFFER) to implement that. BASS will download the file to memory as quickly as possible in the background, and if a network interruption does occur mid-read, the network might recover before playback reaches it, but if not, it will at least not block the decoder. Note the looping buffer/sound is caused by the file reading call getting stuck and blocking the decoder when using the "unbuffered" file system.
The stream's BASS_FILEPROCS functions could simply wrap the normal file reading functions. For example, something like this...
void CALLBACK MyFileCloseProc(void *user)
{
fclose(user); // close the file
}
QWORD CALLBACK MyFileLenProc(void *user)
{
struct stat s;
fstat(fileno(user), &s);
return s.st_size; // return the file length
}
DWORD CALLBACK MyFileReadProc(void *buffer, DWORD length, void *user)
{
return fread(buffer, 1, length, user); // read from file
}
...
BASS_FILEPROCS fileprocs={MyFileCloseProc, MyFileLenProc, MyFileReadProc, NULL}; // callback table
FILE *file=fopen(filename, "rb"); // open the file
stream=BASS_StreamCreateFileUser(STREAMFILE_BUFFER, 0, &fileprocs, file); // create the stream