Hello.
I'm using BASS in a Windows Phone 8.1 project in a background task.
BASS Initialization:
Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero);
Stream creation:
_bassHandle = Bass.BASS_StreamCreateFile(_filePath, 0, (long)_fileSize, BASSFlag.BASS_STREAM_DECODE);
(also tried with BASSFlag.BASS_STREAM_8BITS)
Media Source creation:
...
_info = Bass.BASS_ChannelGetInfo(_bassHandle);
unit bits = 16;
If (_info.Is32bit){ bits = 32;} else If (_info.Is8bit) { bits = 8;}
AudioEncodingProperties pcmprops = AudioEncodingProperties.CreatePcm((uint)_info.freq, (uint)_info.chans, bits)
_source = new MediaStreamSource(new AudioStreamDescriptor(pcmprops));
Creating samples:
byte[] buf = new byte[4096];
int decoded = Bass.BASS_ChannelGetData(_bassHandle, buf, buf.Length);
double secs = Bass.BASS_ChannelBytes2Seconds(m_BassHandle, decoded);
MediaStreamSample sample = MediaStreamSample.CreateFromBuffer(buf.AsBuffer(), TimeSpan.FromSeconds(_currentPosition));
...
The problem is that sound quality is noticeably worse compared to Windows Phone's own MediaPlayer object. There is a noticeable wheezing sound around singer's voice in multiple mp3 files I listened to, and that's just what I can hear.
Is there a catch here? What am I missing?