Author Topic: Just keep getting 0 handle for BASS_Split_StreamCreate  (Read 97 times)

chrisw100

  • Posts: 8
Hello,

ive tried lots of things and totally out of ideas to get just right hand data of a soundcard (so i can encode it to mp3), using BASS_Split_StreamCreate. Record_Start always returns a valid handle, but no matter what changes i make BASS_Split_StreamCreate always returns 0. if i remove the BASS_Split_StreamCreate and reference it all executes fine. This is vb.net

Code: [Select]
        If Not Bass.BASS_RecordInit(-1) Then
            Console.WriteLine("BASS_RecordInit error!")
            Return
        End If

        Dim mapping() As Integer = {1, 1, -1}

        _myRecProc = New RECORDPROC(AddressOf RecordingCallback)

        _recHandle = Bass.BASS_RecordStart(44100, 2, BASSFlag.BASS_SAMPLE_FLOAT Or BASSFlag.BASS_STREAM_DECODE, _myRecProc, IntPtr.Zero)

        Console.WriteLine("Record Handle: " & _recHandle)
        _recHandleSplit = BassMix.BASS_Split_StreamCreate(_recHandle, BASSFlag.BASS_STREAM_DECODE, mapping)

        Console.WriteLine("Split Handle: " & _recHandleSplit)

Ian @ un4seen

  • Administrator
  • Posts: 26094
The BASS_STREAM_DECODE flag isn't valid in a BASS_RecordStart call, but the equivalent is to not use a RECORDPROC callback, like this:

Code: [Select]
        _recHandle = Bass.BASS_RecordStart(44100, 2, BASSFlag.BASS_SAMPLE_FLOAT, Nothing, IntPtr.Zero)

If it still isn't working, please check all function call return values to see if any are failing.