Wasapi if Samplerate changes

Started by udo,

udo

What do I have to do in SYNCPROC/BASS_SYNC_END so that Wasapi outputs the correct sample rate if the new file has a different one?
Reset something?

The Wasapi example uses the mixer. Is this always necessary? We only use playback.

Why is WasapiOutputProc still called although Wasapi called Endsync?
How can I remove Outproc which is passed in BASS_WASAPI_Init?

Ian @ un4seen

Quote from: udoWhat do I have to do in SYNCPROC/BASS_SYNC_END so that Wasapi outputs the correct sample rate if the new file has a different one?
Reset something?

If you're using BASSWASPI, you'll need to call BASS_WASAPI_Init again (after BASS_WASAPI_Free) with the new sample rate. Note it's only possible to change a device's rate in exclusive mode (BASS_WASAPI_EXCLUSIVE).

Quote from: udoThe Wasapi example uses the mixer. Is this always necessary? We only use playback.

No, if you're only playing one file at a time then you probably don't need a mixer. The BASSWASAPI examples mainly use a mixer for resampling purposes because WASAPI didn't originally include resampling support, but it is supported these days (with BASSWASAPI 2.4.4).

Quote from: udoWhy is WasapiOutputProc still called although Wasapi called Endsync?
How can I remove Outproc which is passed in BASS_WASAPI_Init?

BASSWASAPI doesn't have any knowledge of syncs. They're handled by BASS. You can call BASS_WASAPI_Stop and/or BASS_WASAPI_Free to stop BASSWASAPI at the end.

udo

#2
QuoteBASSWASAPI doesn't have any knowledge of syncs. They're handled by BASS...
But its set in BassWasapi.BASS_WASAPI_Init as the penultimate parameter

Where can i set Volume?
Bass.BASS_ChannelSetAttribute(stream, BASSAttribute.BASS_ATTRIB_VOL, volume)
dont work without mixer.
The function is succesful and with Bass.BASS_ChannelGetAttribute(stream, BASSAttribute.BASS_ATTRIB_VOL, ref value) value is correct.
But no change can be heard.
The volume only changes with BassWasapi.BASS_WASAPI_SetVolume. What am I doing wrong?

Playback without mixer is not ok with mp3(22050 Hz). It is played back too fast. What do I have to change? Wasapi is initialized with
BASSWASAPIInit.BASS_WASAPI_EXCLUSIVE | BASSWASAPIInit.BASS_WASAPI_AUTOFORMAT | BASSWASAPIInit.BASS_WASAPI_BUFFER.
The DAC shows 44.1 kHz