Author Topic: record from two sources simultaneously  (Read 1637 times)

pethead

  • Posts: 27
record from two sources simultaneously
« on: 11 Feb '11 - 03:11 »
I need record from two sources.
when I try to init second source then data from first source is spoil.

BASS_RecordInit(0));
BASS_RecordInit(1));
Flag0:=MakeLong(c16BitAudio,cRecordingTime);
RecChannel0:=BASS_RecordStart(vSampleRate,cNumChannels,Flag0,@RecordingCallback0,nil);
Flag1:=MakeLong(c16BitAudio,cRecordingTime);
RecChannel1:=BASS_RecordStart(vSampleRate,cNumChannels,Flag1,@RecordingCallback1,nil);
BASS_ChannelGetData(RecChannel0,@FFTFata,fftconst or BASS_DATA_FFT_INDIVIDUAL or BASS_DATA_FFT_REMOVEDC);
//...show spectrum0
BASS_ChannelGetData(RecChannel1,@FFTFata,fftconst or BASS_DATA_FFT_INDIVIDUAL or BASS_DATA_FFT_REMOVEDC);
//...show spectrum1

when I get FFT from first channel, the fft data is not good when i generate tone 36Hz.

if I init and start only first device then I get FFT very well.

BASS_RecordInit(0));
Flag0:=MakeLong(c16BitAudio,cRecordingTime);
RecChannel0:=BASS_RecordStart(vSampleRate,cNumChannels,Flag0,@RecordingCallback0,nil);
BASS_ChannelGetData(RecChannel0,@FFTFata,fftconst or BASS_DATA_FFT_INDIVIDUAL or BASS_DATA_FFT_REMOVEDC);
//...show spectrum0

what do I wrong?

« Last Edit: 11 Feb '11 - 03:14 by pethead »

mr.sam

  • Guest
Re: record from two sources simultaneously
« Reply #1 on: 11 Feb '11 - 04:30 »
Try to set a device before creating channel.

BASS_RecordSetDevice(0);
RecChannel0:=BASS_RecordStart(vSampleRate,cNumChannels,Flag0,@RecordingCallback0,nil);
BASS_RecordSetDevice(1);
RecChannel1:=BASS_RecordStart(vSampleRate,cNumChannels,Flag1,@RecordingCallback1,nil);

pethead

  • Posts: 27
Re: record from two sources simultaneously
« Reply #2 on: 11 Feb '11 - 10:25 »
YES! I did it (read in Help).