Author Topic: [SOLVED] BASS_RecordGetInputName return device only for -1 (master) in Pascal  (Read 238 times)

Dibo

  • Posts: 8
Hi,

I have latest Bass 2.4 version for linux 64bit. I'm trying to rewrite RECTEST C example to Free Pascal but seems that bass can't find any input devices except -1 which return ansistring "Capture"

Code: (pascal) [Select]
procedure TForm1.AfterConstruction;
var
  c: Integer=0;
  i: PAnsiChar;
begin
  inherited AfterConstruction;

  // For dynamic loading
  //if not Load_BASSDLL(IncludeTrailingPathDelimiter(ExtractFilePath(ParamStr(0)))+'libbass.so') then
  //  raise Exception.Create('Load lib failed');

  if not BASS_RecordInit(-1) then
    raise Exception.Create('Bass record init failed');
  if not BASS_Init(-1,44100,0,nil,nil) then
    raise Exception.Create('Bass init failed');

  i := BASS_RecordGetInputName(c);
  while i<>nil do
  begin
    cmbDevices.Items.Add(i);
    c += 1;
    i := BASS_RecordGetInputName(c);
  end;
end;

As you can see BASS_RecordInit and BASS_Init didn't throw exception so everything is initialized but my combobox which should contain listed input devices, is empty. The BASS_RecordGetInputName(0) return nil ansistring pointer and BASS_RecordGetInputName(-1) "Capture" ansistring. BASS_ErrorGetCode for BASS_RecordGetInputName(0) return BASS_ERROR_ILLPARAM=20. What am I missing here?

Regards
« Last Edit: 28 May '19 - 17:02 by Dibo »

Ian @ un4seen

  • Administrator
  • Posts: 21987
That looks like the PulseAudio recording device, which will be the default device when running on a system that's using PulseAudio. You can use a different device number in your BASS_RecordInit call to access a different recording device. If things still aren't looking right, please use the "alsamixer" tool to confirm what devices and inputs are available on the system and compare that to what BASS is saying.

Dibo

  • Posts: 8
Thanks a lot! My reference was RECTEST example and didn't know that I also must enumerate devices using BASS_RecordInit(N), example use default -1. Now I have much more devices:
Code: [Select]
Capture
Line
Mic
Internal Mic

Regards!