Quantcast
Channel: NAudio
Viewing all articles
Browse latest Browse all 5831

New Post: Ima Adpcm Error during Compression

$
0
0

In  this method i am writing to the writer,

 Private Sub waveIn_DataAvailable(ByVal sender As Object, ByVal e As WaveInEventArgs)

        Try
            If (Me.InvokeRequired) Then     

           Me.BeginInvoke(New waveIn_DataAvailable(AddressOf waveIn_DataAvailable), sender, e)           

                 Else
                If writer IsNot Nothing Then   

                writer.Write(e.Buffer, 0, e.BytesRecorded)   

                secondsRecorded = (writer.Length / writer.WaveFormat.AverageBytesPerSecond)
                    If (secondsRecorded >= 60) Then                       

                     StopRecording(sender)                   

                 End If
                End If

            End If
        Catch ex As Exception   

        MsgBox(ex.Message)     

  End Try
    End Sub

 

here, i am closing

Private Sub waveIn_RecordingStopped(ByVal sender As Object, ByVal e As EventArgs)
        Try
            If (Me.InvokeRequired) Then   

            Me.BeginInvoke(New waveIn_RecordingStopped(AddressOf waveIn_RecordingStopped), sender, e)     

      Else             

  waveIn.Dispose()       

        waveIn = Nothing     

          writer.Close()   

            writer = Nothing


            End If
        Catch ex As Exception     

      MsgBox(ex.Message)   

    End Try   

End Sub


Viewing all articles
Browse latest Browse all 5831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>