I have data buffer from mic, at RecordWasapiProc( buffer: pointer; length: dword )...
Is there any method how detect any voice ?
I know one solution, create new channel and feeed it by data from RecordWasapiProc... and use BASS BASS_ChannelGetLevel... Is it right decision, or there is any beth method ? i need only VOX (voice activation control).
You could indeed feed the data to a push stream (via BASS_StreamPutData) and get the peak level back from BASS_ChannelGetLevel, but another option is to check the data directly yourself, something like this...
DWORD CALLBACK WasapiProc(void *buffer, DWORD length, void *user)
{
float *s=(float*)buffer;
float peak=0;
for (int a=0; a<length/sizeof(float); a++) {
if (peak<fabs(s[a])) peak=fabs(s[a]);
}
// do something with the peak information here
}
Second question is: Is it albe to initialize 2 sound card at one application ?
for swing between it use (BASS_WASAPI_SetDevice ?) My big problem is that i canot detect what device calls inside
recording procedure CALLBACK WASAPIPROC.
Yes, you can use multiple devices simultaneously. You can use BASS_WASAPI_GetDevice in a WASAPIPROC function to detect which device it is dealing with.