Author Topic: BASS_ASIO_Monitor  (Read 117 times)

SotirisPapad

  • Posts: 9
BASS_ASIO_Monitor
« on: 15 Apr '17 - 07:36 »
I am try this function to hear mic sound without latency in my headphones.
Is it possimple ?
I can't understud the gain and pan parameter. 


Ian @ un4seen

  • Administrator
  • Posts: 19894
Re: BASS_ASIO_Monitor
« Reply #1 on: 17 Apr '17 - 16:25 »
Assuming you want the sound to be centred at 0 dB (normal level), then "gain" should be set to 0x20000000 and "pan" set to 0x40000000, like this:

Code: [Select]
result = BASS_ASIO_Monitor(input, output, 0x20000000, 1, 0x40000000);

Note that BASS_ASIO_Monitor isn't supported by all devices, and the output/gain/pan settings may also be ignored by some. In that case, you could use BASS_ASIO_ChannelEnableMirror instead:

Code: [Select]
result = BASS_ASIO_ChannelEnableMirror(output, true, input);

SotirisPapad

  • Posts: 9
Re: BASS_ASIO_Monitor
« Reply #2 on: 18 Apr '17 - 00:49 »
I tried but it's hard for me.
If you have some code for Delphi would be very useful for me

3delite

  • Posts: 869
Re: BASS_ASIO_Monitor
« Reply #3 on: 18 Apr '17 - 10:45 »
This seems working here:

Code: [Select]
procedure TForm1.Button1Click(Sender: TObject);
begin
    // not playing anything via BASS, so don't need an update thread
    BASS_SetConfig(BASS_CONFIG_UPDATEPERIOD,0);
    // init BASS (for the FX)
    BASS_Init(0,44100,0,0,nil);

    // init ASIO - first device
    if not (BASS_ASIO_Init(0,0)) then begin
        BASS_Free();
        ShowMessage('Can''t initialize ASIO');
    end;

    if NOT BASS_ASIO_ChannelEnableMirror(0, true, 0) then begin
        Showmessage('Error: BASS_ASIO_Monitor ' + IntToStr(BASS_ASIO_ErrorGetCode));
    end;

    if NOT BASS_ASIO_ChannelEnableMirror(1, true, 1) then begin
        Showmessage('Error: BASS_ASIO_Monitor ' + IntToStr(BASS_ASIO_ErrorGetCode));
    end;

    BASS_ASIO_Start(0,1);

end;