19 May '13 - 05:53 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  Developments / BASS / Recording with BASSAsio and VB.NET on: 7 May '12 - 17:47
I am trying to record an input from a soundcard to a .wav file using ASIO and VB.net. The asiorecording C# example works on my system so I assume the hardware and drivers are OK. When I run my VB code no .wav file is created. The declarations are:

    Private wav As Un4seen.Bass.Misc.EncoderWAV
    Private enc As Un4seen.Bass.Misc.BaseEncoder
    Private AsioInfo As Un4seen.BassAsio.BASS_ASIO_INFO
    Private myasio As Un4seen.BassAsio.BassAsioHandler


and the code:

        Dim info As Un4seen.BassAsio.BASS_ASIO_CHANNELINFO = New Un4seen.BassAsio.BASS_ASIO_CHANNELINFO
        Dim chan As Integer = 0
        Do While True
            If Not Un4seen.BassAsio.BassAsio.BASS_ASIO_ChannelGetInfo(False, chan, info) Then
                Exit Do
            End If
            chan += 1
        Loop

        myasio = New Un4seen.BassAsio.BassAsioHandler(True, 0, 0, 2, Un4seen.BassAsio.BASSASIOFormat.BASS_ASIO_FORMAT_16BIT, 44100)

        myasio.setmirror(0)

        AsioInfo = Un4seen.BassAsio.BassAsio.BASS_ASIO_GetInfo()

        Dim IsOK As Boolean
        IsOK = myasio.Start(AsioInfo.bufmax)

        If Not IsOK Then
            MsgBox("Could not start ASIO : " & Un4seen.BassAsio.BassAsio.BASS_ASIO_ErrorGetCode().ToString())
        End If

        wav = New Un4seen.Bass.Misc.EncoderWAV(myasio.InputChannel)
        wav.InputFile = Nothing
        wav.OutputFile = "d:\test.wav"
        wav.Start(Nothing, IntPtr.Zero, False)
        enc = wav


The code is modeled on that in the C# example. Any help is appreciated.

Thanks

Chris
ReplyReply Reply with quoteQuote
Pages: [1]
Powered by SMF 1.1.18 | SMF © 2013, Simple Machines