Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Folks
Engaging in a project as a newbie in soundscan, encountered problems while implementing this simple piece of code. It's my appreciation if you lead me through this dense un-documented forest by microsoft:-( !!
P.S.1 : Please introduce me a cook-book or any useful tutorial or documentation in directsound what i couldn't find it anywhere!!!
P.S.2:You can also find the code here:http://www.4shared.com/get/j0J8g6wA/SSM-VBNET-DirectSound.html[^]
Tnx:-).

VB.NET
#Region "References"
 mports Microsoft.DirectX
Imports Microsoft.DirectX.DirectSound
Imports System.Threading
#End Region

Friend Class frm_main
...
#Region "Command Button"
     Private Sub cmd_capture_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd_capture.Click
        Try
            If Not devices_waveformat() Then Return
            DSBuffer.Start(False)
            Thread.Sleep((DSSamples / DSFrequency) * 1000)
            'Containing Input Data
            Dim DSArray As Array = DSBuffer.Read(0, Type.GetType("Integer"), LockFlag.FromWriteCursor, DSFormatArray)
            DSBuffer.Stop()
        Catch ex As Exception
            Debug.WriteLine(ex.Message)
            Debug.WriteLine(ex.ToString)
        End Try
    End Sub

#End Region
...
End Class
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900