26 May '13 - 02:05 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: BassEnc recording first 2 channels from an 8 channel Mixer  (Read 276 times)
HarryHar
Posts: 135


« on: 4 Jul '12 - 22:22 »
Reply with quoteQuote

Hello,

I have got an 8 channel Decoding Mixer. I would like to record the first 2 channels.

I feed the decoding channel from the Mixer into a BassAsioHandler. When I also feed this decoding channel in the encoder it records the output from all 8 channels.

I tried to feed the decoding channel into a new Mixer and use a MatrixMixer ot only select the first 2 channels, but then the encoded file is empty. When I Use BASS_ChannelGetData the encoded output is filled, but this steals samples from the ASIO output.

Any help would be appreciated.
Logged
Ian @ un4seen
Administrator
Posts: 15276


« Reply #1 on: 5 Jul '12 - 14:00 »
Reply with quoteQuote

One way you could achieve what you want is to feed the data into a "push" stream and use a splitter stream to extract & encode the first 2 channels from it. It could look something like this...

encstream=BASS_StreamCreate(freq, chans, BASS_SAMPLE_FLOAT|BASS_STREAM_DECODE, STREAMPROC_PUSH, NULL); // create a push stream with same sample format as the mixer
int chanmap[]={0, 1, -1}; // channel mapping for first 2 channels
encsplit=BASS_Split_StreamCreate(encstream, BASS_STREAM_DECODE, chanmap); // create a splitter to extract first 2 channels for the encoder
BASS_Encode_Start(encsplit, ...); // set an encoder on it

...

DWORD CALLBACK AsioProc(BOOL input, DWORD channel, void *buffer, DWORD length, void *user)
{
DWORD c=BASS_ChannelGetData(mixer, buffer, length); // get some data from the mixer for the ASIO output
if (c==(DWORD)-1) c=0; // an error, no data
else {
BASS_StreamPutData(encstream, buffer, c); // feed the data to the encoding stream
BYTE temp[20000]; // processing buffer
while (BASS_ChannelGetData(encsplit, temp, sizeof(temp))) ; // process the data (extract first 2 channels and encode it)
}
return c;
}
Logged
HarryHar
Posts: 135


« Reply #2 on: 5 Jul '12 - 21:19 »
Reply with quoteQuote

Hi Ian,

Thank you very much, that works like a charm.

Kind regards,
Harold
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines