21 May '13 - 18:12 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: Kindly help with Error Can't initialize device error code: 23  (Read 761 times)
Dextergaisie
Posts: 3


« on: 25 Jun '12 - 14:51 »
Reply with quoteQuote

I would be very grateful if anyone could help resolve this error. I used the Sample bass Recorder entirely in my program. It worked fine on my system XP and other versions of windows 7 but unfortunately I found out it doesnt work on some systems with Vista by returning the error - Can't initialize device error code: 23

Please help on how to resolve this issue. Thanx in advance.
Logged
Ian @ un4seen
Administrator
Posts: 15259


« Reply #1 on: 25 Jun '12 - 16:42 »
Reply with quoteQuote

Error code 32 is BASS_ERROR_DEVICE, which means that the requested device number (eg. in a BASS_RecordInit call) is invalid. What device number are you using in your BASS_RecordInit call? If it's 0, and you're still getting that error, then it would appear that the system doesn't have any recording devices. You can check that in the Sound control panel (right-click on the tray speaker icon and select "Recording Devices").
Logged
Dextergaisie
Posts: 3


« Reply #2 on: 25 Jun '12 - 18:23 »
Reply with quoteQuote

Okay great, in this case how do I tackle the error from being shown at all. Cos, when this error pops up, the application terminates itself. I would wish to alert the user about the current issue though the message box so then he/she would be aware she would get use the recording feature of the program at all.

Thank you.
Logged
Dextergaisie
Posts: 3


« Reply #3 on: 25 Jun '12 - 20:53 »
Reply with quoteQuote

OKAY I FOUND A WAY ROUND IT AND FIXED IT. Smiley


Public Sub INITIALIZE_RECORDER()
'############################################### RECORDER
With frmMain
    ' change and set the current path, to prevent from VB not finding BASS.DLL
    ChDrive App.Path
    ChDir App.Path

    ' check the correct BASS was loaded
    If (HiWord(BASS_GetVersion) <> BASSVERSION) Then
        Call MsgBox(Msg1, vbCritical)
        End
    End If

    ' setup recording and output devices (using default devices)
   
If (BASS_RecordInit(-1) = 0) Or (BASS_Init(-1, 44100, 0, .hWnd, 0) = 0) Then
        Call Error_("Can't initialize device")
           
   MsgBox "Sorry there was an issue trying to initilize your system's recording device." & vbCrLf & _
           "It seems there are no recording devices present. If otherwise, then kindly check whether it has been installed and configured properly." & vbCrLf & _
           "The recording feature of this program would be therefore be disabled!", vbOKOnly + vbCritical, "Error! - NO RECORDING DEVICES FOUND!"
              
         With frmMain
                 .mnRecordStream.Enabled = False
                   .cmbInput.Enabled = False
                 .btnPlay.Enabled = False
                 .btnRecord.Enabled = False
                    .btnSave.Enabled = False
              End With
        'End
    Else
        ' get list of inputs
        Dim C As Integer
        input_ = -1
        While BASS_RecordGetInputName(C)
            .cmbInput.AddItem VBStrFromAnsiPtr(BASS_RecordGetInputName(C))
            If (BASS_RecordGetInput(C, ByVal 0) And BASS_INPUT_OFF) = 0 Then
                .cmbInput.ListIndex = C  ' this 1 is currently "on"
                input_ = C
                UpdateInputInfo   ' display info
            End If
            C = C + 1
        Wend
    End If

    .tmrRecTest.Enabled = True   ' timer to update the position display (200ms)

    recPtr = 0
    reclen = 0
    BUFSTEP = 200000    ' memory allocation unit


.cmbInput.ListIndex = 5

End With

Exit Sub

end if
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines