OK, Thanks Bernd!
Another question regarding ASIO.
I'm trying to add a input from my ASIO soundcard (from a microphone needing low latency) as a channel on a BASSmixer. But When adding my input channel I only get hum/noice. (recording with your ASIO recording example works fine, so the input source works...)
Here is how I init Bass and the mixer.
private BassAsioHandler asio;
private BassAsioHandler asioInput;
/////////
Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_UPDATEPERIOD, 0);
if (Bass.BASS_Init(0, 48000, 0, IntPtr.Zero, null))
{
// init the winamp DSP plugin
BassWaDsp.BASS_WADSP_Init(IntPtr.Zero);
}
else
{
MessageBox.Show(this, "Bass_Init error!");
return;
}
//Mixer
_mixer = BassMix.BASS_Mixer_StreamCreate(44100, 2, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_MIXER_NONSTOP);
if (_mixer == 0)
{
MessageBox.Show(this, "Could not create mixer!");
Bass.BASS_Free();
return;
}
//Asio
if (_mixer != 0)
asio = new BassAsioHandler(0, 0, _mixer);
//Add ASIO input
asioInput = new BassAsioHandler(true, 0, 0, 2, BASSASIOFormat.BASS_ASIO_FORMAT_16BIT, 44100);
_inputChannel1 = asioInput.InputChannel;
//Start ASIO
BassAsio.BASS_ASIO_Start(0);
and I "switching" on/off the inputchannel from the mixer like this:
private void checkBox1_Click(object sender, RoutedEventArgs e)
{
if (checkBox1.IsChecked.Value)
{
BassMix.BASS_Mixer_ChannelRemove(_inputChannel1);
BassMix.BASS_Mixer_StreamAddChannel(_mixer, _inputChannel1, BASSFlag.BASS_MIXER_DOWNMIX);
}
else
{
BassMix.BASS_Mixer_ChannelRemove(_inputChannel1);
}
}
First is it possible, if it is, what do I wrong?