Author Topic: BASS_WASAPI_GetInfo doesn't return sample bit depth  (Read 170 times)

altairish

  • Posts: 2
Hello,

I wanted to use BASS_WASAPI_GetInfo to check what bit format a soundcard can handle. But the info.format returns 0 even though all the other information is there (Freq, channels, etc).

I am using Windows 10 and Visual Basic 6. Here is my code:

Code: [Select]
Private Sub Form_Load()

    ChDrive App.Path
    ChDir App.Path
    If (HiWord(BASS_GetVersion) <> BASSVERSION) Then
        Call MsgBox("An incorrect version of BASS.DLL was loaded", vbCritical)
        End
    End If

    ' not playing anything via BASS, so don't need an update thread
    Call BASS_SetConfig(BASS_CONFIG_UPDATETHREADS, 0)

    ' setup BASS - "no sound" device
    Call BASS_Init(0, 48000, 0, 0, 0)
   
    If (BASS_WASAPI_Init(-1, 0, 0, 0, 0.4, 0.05, AddressOf OutWasapiProc, 0)) Then
        Dim wi As BASS_WASAPI_INFO

        Call BASS_WASAPI_GetInfo(wi)
       
        Debug.Print wi.format
        Debug.Print wi.freq, wi.chans

    End If
End Sub

Am I doing something wrong?

Best regards, Al

altairish

  • Posts: 2
Re: BASS_WASAPI_GetInfo doesn't return sample bit depth
« Reply #1 on: 7 Jan '22 - 20:26 »
 ::)

Solved...
I need to use the BASS_WASAPI_EXCLUSIVE flag when initializing, or it wont work!

MB_SOFT

  • Posts: 417
Re: BASS_WASAPI_GetInfo doesn't return sample bit depth
« Reply #2 on: 8 Jan '22 - 15:11 »
strange ...here is working without BASS_WASAPI_EXCLUSIVE flag