OK. If the written WAV file sounds fine, then that means the problem isn't in the original file data or the decoder. Another possibility is that the output is briefly stalling, ie. running out of data to play. To check that, you can set a BASS_SYNC_STALL sync and see if it gets triggered, something like this:
BASS.SYNCPROC StallSync=new BASS.SYNCPROC() {
public void SYNCPROC(int handle, int channel, int data, Object user) {
// do something here, eg. display/log problem
}
};
BASS.BASS_ChannelSetSync(handle, BASS.BASS_SYNC_STALL, 0, StallSync, 0);
Another possibility is that the app is being starved of CPU time. Does the problem only happen when the app is in the background, and if so, have you implemented a "foreground service"?