<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Recording mic and split stereo into two mono wav' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Recording mic and split stereo into two mono wav' posted on the 'DirectSound' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Wed, 19 Jun 2013 23:04:34 -0700</pubDate>
    <lastBuildDate>Wed, 19 Jun 2013 23:04:34 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Recording mic and split stereo into two mono wav</title>
      <link>http://www.programmersheaven.com/mb/DirectSound/417333/417333/recording-mic-and-split-stereo-into-two-mono-wav/</link>
      <description>Hello,&lt;br /&gt;
&lt;br /&gt;
I need help.. I have problem with splitting left &amp;amp; right channel from captured stream from mic (or sound card)&lt;br /&gt;
&lt;br /&gt;
Imports Microsoft.DirectX&lt;br /&gt;
Imports Microsoft.DirectX.DirectSound&lt;br /&gt;
Imports System.Threading&lt;br /&gt;
Imports System.IO&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Public PositionNotify As BufferPositionNotify() = New Microsoft.DirectX.DirectSound.BufferPositionNotify
(NumberRecordNotifications) {}&lt;br /&gt;
    Public Const NumberRecordNotifications As Integer = 16&lt;br /&gt;
    Public NotificationEvent As AutoResetEvent = Nothing&lt;br /&gt;
    Public applicationBuffer As CaptureBuffer = Nothing&lt;br /&gt;
    Public CaptureDeviceGuid As Guid = Guid.Empty&lt;br /&gt;
    Public applicationDevice As Capture = Nothing&lt;br /&gt;
&lt;br /&gt;
    Private FileName As String = String.Empty&lt;br /&gt;
    Private FileName2 As String = String.Empty&lt;br /&gt;
&lt;br /&gt;
    Public applicationNotify As Notify = Nothing&lt;br /&gt;
    Private NotifyThread As Thread = Nothing&lt;br /&gt;
&lt;br /&gt;
    Private Wave As FileStream = Nothing&lt;br /&gt;
&lt;br /&gt;
    Private Writer As BinaryWriter = Nothing&lt;br /&gt;
&lt;br /&gt;
    Private Path As String = String.Empty&lt;br /&gt;
    Public CaptureBufferSize As Integer = 0&lt;br /&gt;
    Public NextCaptureOffset As Integer = 0&lt;br /&gt;
    Private Recording As Boolean = False&lt;br /&gt;
    Public InputFormat As WaveFormat&lt;br /&gt;
    Private SampleCount As Integer = 0&lt;br /&gt;
    Public NotifySize As Integer = 0&lt;br /&gt;
    Private counter As Integer = 0&lt;br /&gt;
    Private Capturing As Boolean = False&lt;br /&gt;
&lt;br /&gt;
    Private strx As New MemoryStream&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load&lt;br /&gt;
        Dim captureDevicesCollection As New CaptureDevicesCollection&lt;br /&gt;
        Console.WriteLine(captureDevicesCollection(2).Desc
ription)&lt;br /&gt;
        CaptureDeviceGuid = captureDevicesCollection(2).DriverGuid&lt;br /&gt;
        With InputFormat&lt;br /&gt;
            .AverageBytesPerSecond = 192000&lt;br /&gt;
            .BitsPerSample = 16&lt;br /&gt;
            .BlockAlign = 4&lt;br /&gt;
            .Channels = 2&lt;br /&gt;
            .FormatTag = WaveFormatTag.Pcm&lt;br /&gt;
            .SamplesPerSecond = 48000&lt;br /&gt;
        End With&lt;br /&gt;
        FileName = "C:\test.wav"&lt;br /&gt;
        ' FileName2 = "C:\testLeft.wav"&lt;br /&gt;
        Try&lt;br /&gt;
            applicationDevice = New Capture(CaptureDeviceGuid)&lt;br /&gt;
            CreateCaptureBuffer()&lt;br /&gt;
            OnCreateSoundFile()&lt;br /&gt;
        Catch ex As Exception&lt;br /&gt;
            Console.WriteLine(ex.Message)&lt;br /&gt;
        End Try&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub CreateCaptureBuffer()&lt;br /&gt;
        '-----------------------------------------------------------------------------&lt;br /&gt;
        ' Name: CreateCaptureBuffer()&lt;br /&gt;
        ' Desc: Creates a capture buffer and sets the format &lt;br /&gt;
        '-----------------------------------------------------------------------------&lt;br /&gt;
        Dim dscheckboxd As New CaptureBufferDescription()&lt;br /&gt;
&lt;br /&gt;
        If applicationNotify IsNot Nothing Then&lt;br /&gt;
            applicationNotify.Dispose()&lt;br /&gt;
            applicationNotify = Nothing&lt;br /&gt;
        End If&lt;br /&gt;
        If applicationBuffer IsNot Nothing Then&lt;br /&gt;
            applicationBuffer.Dispose()&lt;br /&gt;
            applicationBuffer = Nothing&lt;br /&gt;
        End If&lt;br /&gt;
&lt;br /&gt;
        If 0 = InputFormat.Channels Then&lt;br /&gt;
            Return&lt;br /&gt;
        End If&lt;br /&gt;
&lt;br /&gt;
        ' Set the notification size&lt;br /&gt;
        NotifySize = IIf((1024 &amp;gt; InputFormat.AverageBytesPerSecond / 8), 1024, (InputFormat.AverageBytesPerSecond / 8))&lt;br /&gt;
        NotifySize -= NotifySize Mod InputFormat.BlockAlign&lt;br /&gt;
&lt;br /&gt;
        ' Set the buffer sizes&lt;br /&gt;
        CaptureBufferSize = NotifySize * NumberRecordNotifications&lt;br /&gt;
&lt;br /&gt;
        ' Create the capture buffer&lt;br /&gt;
        dscheckboxd.BufferBytes = CaptureBufferSize&lt;br /&gt;
        InputFormat.FormatTag = WaveFormatTag.Pcm&lt;br /&gt;
         dscheckboxd.Format = InputFormat&lt;br /&gt;
        ' Set the format during creatation&lt;br /&gt;
        applicationBuffer = New CaptureBuffer(dscheckboxd, applicationDevice)&lt;br /&gt;
        NextCaptureOffset = 0&lt;br /&gt;
&lt;br /&gt;
        InitNotifications()&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub InitNotifications()&lt;br /&gt;
        '-----------------------------------------------------------------------------&lt;br /&gt;
        ' Name: InitNotifications()&lt;br /&gt;
        ' Desc: Inits the notifications on the capture buffer which are handled&lt;br /&gt;
        '       in the notify thread.&lt;br /&gt;
        '-----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
        If applicationBuffer Is Nothing Then&lt;br /&gt;
            Throw New NullReferenceException()&lt;br /&gt;
        End If&lt;br /&gt;
&lt;br /&gt;
        ' Create a thread to monitor the notify events&lt;br /&gt;
        If NotifyThread Is Nothing Then&lt;br /&gt;
            NotifyThread = New Thread(New ThreadStart(AddressOf WaitThread))&lt;br /&gt;
            Capturing = True&lt;br /&gt;
            NotifyThread.Start()&lt;br /&gt;
&lt;br /&gt;
            ' Create a notification event, for when the sound stops playing&lt;br /&gt;
            NotificationEvent = New AutoResetEvent(False)&lt;br /&gt;
        End If&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        ' Setup the notification positions&lt;br /&gt;
        For i As Integer = 0 To NumberRecordNotifications - 1&lt;br /&gt;
            PositionNotify(i).Offset = (NotifySize * i) + NotifySize - 1&lt;br /&gt;
            PositionNotify(i).EventNotifyHandle = NotificationEvent.Handle&lt;br /&gt;
        Next&lt;br /&gt;
&lt;br /&gt;
        applicationNotify = New Notify(applicationBuffer)&lt;br /&gt;
&lt;br /&gt;
        ' Tell DirectSound when to notify the app. The notification will come in the from &lt;br /&gt;
        ' of signaled events that are handled in the notify thread.&lt;br /&gt;
        applicationNotify.SetNotificationPositions(Positio
nNotify, NumberRecordNotifications)&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub WaitThread()&lt;br /&gt;
        While Capturing&lt;br /&gt;
            'Sit here and wait for a message to arrive&lt;br /&gt;
            NotificationEvent.WaitOne(Timeout.Infinite, True)&lt;br /&gt;
            RecordCapturedData()&lt;br /&gt;
        End While&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub RecordCapturedData()&lt;br /&gt;
        '-----------------------------------------------------------------------------&lt;br /&gt;
        ' Name: RecordCapturedData()&lt;br /&gt;
        ' Desc: Copies data from the capture buffer to the output buffer &lt;br /&gt;
        '-----------------------------------------------------------------------------&lt;br /&gt;
        Dim CaptureData As Byte() = Nothing&lt;br /&gt;
        Dim buffLeft As Byte() = Nothing&lt;br /&gt;
        Dim buffRight As Byte() = Nothing&lt;br /&gt;
        Dim ReadPos As Integer&lt;br /&gt;
        Dim CapturePos As Integer&lt;br /&gt;
        Dim LockSize As Integer&lt;br /&gt;
&lt;br /&gt;
        applicationBuffer.GetCurrentPosition(CapturePos, ReadPos)&lt;br /&gt;
        LockSize = ReadPos - NextCaptureOffset&lt;br /&gt;
        If LockSize &amp;lt; 0 Then&lt;br /&gt;
            LockSize += CaptureBufferSize&lt;br /&gt;
        End If&lt;br /&gt;
&lt;br /&gt;
        ' Block align lock size so that we are always write on a boundary&lt;br /&gt;
        LockSize -= (LockSize Mod NotifySize)&lt;br /&gt;
&lt;br /&gt;
        If 0 = LockSize Then&lt;br /&gt;
            Return&lt;br /&gt;
        End If&lt;br /&gt;
&lt;br /&gt;
        ' Read the capture buffer.&lt;br /&gt;
        CaptureData = DirectCast(applicationBuffer.Read(NextCaptureOffse
t, GetType(Byte), LockFlag.None, LockSize), Byte())&lt;br /&gt;
&lt;br /&gt;
        ReDim buffLeft(24000)&lt;br /&gt;
        ' ReDim buffLeft(UBound(CaptureData))&lt;br /&gt;
        ''ReDim buffRight(UBound(buffLeft))&lt;br /&gt;
        Dim InPos As Long = 0&lt;br /&gt;
        Dim OutPos As Long = 0&lt;br /&gt;
        Dim counter As Long = 0&lt;br /&gt;
&lt;br /&gt;
        For InPos = 1 To 24000 - 1 Step 2&lt;br /&gt;
            buffLeft(OutPos) = CaptureData(InPos)&lt;br /&gt;
            OutPos += 1&lt;br /&gt;
        Next InPos&lt;br /&gt;
&lt;br /&gt;
        SampleCount += buffLeft.Length - 1&lt;br /&gt;
        Writer.Write(buffLeft, 0, buffLeft.Length - 1)&lt;br /&gt;
&lt;br /&gt;
        ' Move the capture offset along&lt;br /&gt;
        NextCaptureOffset += CaptureData.Length&lt;br /&gt;
        NextCaptureOffset = NextCaptureOffset Mod CaptureBufferSize&lt;br /&gt;
        ' Circular buffer&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub checkboxRecord_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles checkboxRecord.CheckedChanged&lt;br /&gt;
        Recording = Not Recording&lt;br /&gt;
        StartOrStopRecord(Recording)&lt;br /&gt;
&lt;br /&gt;
        If Not Recording Then&lt;br /&gt;
            checkboxRecord.Enabled = False&lt;br /&gt;
        End If&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub StartOrStopRecord(ByVal StartRecording As Boolean)&lt;br /&gt;
        '-----------------------------------------------------------------------------&lt;br /&gt;
        ' Name: StartOrStopRecord()&lt;br /&gt;
        ' Desc: Starts or stops the capture buffer from recording&lt;br /&gt;
        '-----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
        If StartRecording Then&lt;br /&gt;
            ' Create a capture buffer, and tell the capture &lt;br /&gt;
            ' buffer to start recording   &lt;br /&gt;
            CreateCaptureBuffer()&lt;br /&gt;
            applicationBuffer.Start(True)&lt;br /&gt;
        Else&lt;br /&gt;
            ' Stop the buffer, and read any data that was not &lt;br /&gt;
            ' caught by a notification&lt;br /&gt;
            applicationBuffer.[Stop]()&lt;br /&gt;
&lt;br /&gt;
            RecordCapturedData()&lt;br /&gt;
&lt;br /&gt;
            Writer.Seek(4, SeekOrigin.Begin)&lt;br /&gt;
            ' Seek to the length descriptor of the RIFF file.&lt;br /&gt;
            Writer.Write(CInt(SampleCount + 36))&lt;br /&gt;
            ' Write the file length, minus first 8 bytes of RIFF description.&lt;br /&gt;
            Writer.Seek(40, SeekOrigin.Begin)&lt;br /&gt;
            ' Seek to the data length descriptor of the RIFF file.&lt;br /&gt;
            Writer.Write(SampleCount)&lt;br /&gt;
            ' Write the length of the sample data in bytes.&lt;br /&gt;
            Writer.Close()&lt;br /&gt;
            ' Close the file now.&lt;br /&gt;
            Writer = Nothing&lt;br /&gt;
            '&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br /&gt;
            '-------------------------------------&lt;br /&gt;
            ' Set the writer to null.&lt;br /&gt;
            ' Set the FileStream to null.&lt;br /&gt;
            Wave = Nothing&lt;br /&gt;
        End If&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Private Sub CreateRIFF()&lt;br /&gt;
        '*************************************************
************************&lt;br /&gt;
        '			 &lt;br /&gt;
        '			Here is where the file will be created. A&lt;br /&gt;
        '			wave file is a RIFF file, which has chunks&lt;br /&gt;
        '			of data that describe what the file contains.&lt;br /&gt;
        '			A wave RIFF file is put together like this:&lt;br /&gt;
        '			 &lt;br /&gt;
        '			The 12 byte RIFF chunk is constructed like this:&lt;br /&gt;
        '			Bytes 0 - 3 :	'R' 'I' 'F' 'F'&lt;br /&gt;
        '			Bytes 4 - 7 :	Length of file, minus the first 8 bytes of the RIFF description.&lt;br /&gt;
        '							(4 bytes for "WAVE" + 24 bytes for format chunk length +&lt;br /&gt;
        '							8 bytes for data chunk description + actual sample data size.)&lt;br /&gt;
        '			Bytes 8 - 11:	'W' 'A' 'V' 'E'&lt;br /&gt;
        '			&lt;br /&gt;
        '			The 24 byte FORMAT chunk is constructed like this:&lt;br /&gt;
        '			Bytes 0 - 3 :	'f' 'm' 't' ' '&lt;br /&gt;
        '			Bytes 4 - 7 :	The format chunk length. This is always 16.&lt;br /&gt;
        '			Bytes 8 - 9 :	File padding. Always 1.&lt;br /&gt;
        '			Bytes 10- 11:	Number of channels. Either 1 for mono,  or 2 for stereo.&lt;br /&gt;
        '			Bytes 12- 15:	Sample rate.&lt;br /&gt;
        '			Bytes 16- 19:	Number of bytes per second.&lt;br /&gt;
        '			Bytes 20- 21:	Bytes per sample. 1 for 8 bit mono, 2 for 8 bit stereo or&lt;br /&gt;
        '							16 bit mono, 4 for 16 bit stereo.&lt;br /&gt;
        '			Bytes 22- 23:	Number of bits per sample.&lt;br /&gt;
        '			&lt;br /&gt;
        '			The DATA chunk is constructed like this:&lt;br /&gt;
        '			Bytes 0 - 3 :	'd' 'a' 't' 'a'&lt;br /&gt;
        '			Bytes 4 - 7 :	Length of data, in bytes.&lt;br /&gt;
        '			Bytes 8 -...:	Actual sample data.&lt;br /&gt;
        '			&lt;br /&gt;
        '		**************************************************
************************&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        ' Open up the wave file for writing.&lt;br /&gt;
        Wave = New FileStream(FileName, FileMode.Create)&lt;br /&gt;
        '  WaveFileLeft = New FileStream(FileName2, FileMode.Create)&lt;br /&gt;
        Writer = New BinaryWriter(Wave)&lt;br /&gt;
&lt;br /&gt;
        ' Set up file with RIFF chunk info.&lt;br /&gt;
        Dim ChunkRiff As Char() = {"R"c, "I"c, "F"c, "F"c}&lt;br /&gt;
        Dim ChunkType As Char() = {"W"c, "A"c, "V"c, "E"c}&lt;br /&gt;
        Dim ChunkFmt As Char() = {"f"c, "m"c, "t"c, " "c}&lt;br /&gt;
        Dim ChunkData As Char() = {"d"c, "a"c, "t"c, "a"c}&lt;br /&gt;
&lt;br /&gt;
        Dim shPad As Short = 1&lt;br /&gt;
        ' File padding&lt;br /&gt;
        Dim nFormatChunkLength As Integer = &amp;amp;H10&lt;br /&gt;
        ' Format chunk length.&lt;br /&gt;
        Dim nLength As Integer = 0&lt;br /&gt;
        ' File length, minus first 8 bytes of RIFF description. This will be filled in later.&lt;br /&gt;
        Dim shBytesPerSample As Short = 0&lt;br /&gt;
        ' Bytes per sample.&lt;br /&gt;
        ' Figure out how many bytes there will be per sample.&lt;br /&gt;
        If 8 = InputFormat.BitsPerSample AndAlso 1 = InputFormat.Channels Then&lt;br /&gt;
            shBytesPerSample = 1&lt;br /&gt;
        ElseIf (8 = InputFormat.BitsPerSample AndAlso 2 = InputFormat.Channels) OrElse (16 = InputFormat.BitsPerSample AndAlso 1 = InputFormat.Channels) Then&lt;br /&gt;
            shBytesPerSample = 2&lt;br /&gt;
        ElseIf 16 = InputFormat.BitsPerSample AndAlso 2 = InputFormat.Channels Then&lt;br /&gt;
            shBytesPerSample = 4&lt;br /&gt;
        End If&lt;br /&gt;
&lt;br /&gt;
        ' Fill in the riff info for the wave file.&lt;br /&gt;
        Writer.Write(ChunkRiff)&lt;br /&gt;
        Writer.Write(nLength)&lt;br /&gt;
        Writer.Write(ChunkType)&lt;br /&gt;
&lt;br /&gt;
        '.AverageBytesPerSecond = 192000&lt;br /&gt;
        '.BitsPerSample = 16&lt;br /&gt;
        '.BlockAlign = 4&lt;br /&gt;
        '.Channels = 2&lt;br /&gt;
        '.FormatTag = WaveFormatTag.Pcm&lt;br /&gt;
        '.SamplesPerSecond = 48000&lt;br /&gt;
&lt;br /&gt;
        ' Fill in the format info for the wave file.&lt;br /&gt;
        Writer.Write(ChunkFmt)&lt;br /&gt;
        Writer.Write(nFormatChunkLength)&lt;br /&gt;
        Writer.Write(shPad)&lt;br /&gt;
        Writer.Write(InputFormat.Channels) 'channels&lt;br /&gt;
        Writer.Write(InputFormat.SamplesPerSecond) 'samplepersecond&lt;br /&gt;
        Writer.Write(InputFormat.AverageBytesPerSecond) 'averagebytespersecond&lt;br /&gt;
        Writer.Write(shBytesPerSample) 'bytespersample&lt;br /&gt;
        Writer.Write(InputFormat.BitsPerSample) 'bitspersample&lt;br /&gt;
&lt;br /&gt;
        ' Now fill in the data chunk.&lt;br /&gt;
        Writer.Write(ChunkData)&lt;br /&gt;
        Writer.Write(CInt(0))&lt;br /&gt;
        ' The sample length will be written in later.&lt;br /&gt;
        '&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt
;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub OnCreateSoundFile()&lt;br /&gt;
        '-----------------------------------------------------------------------------&lt;br /&gt;
        ' Name: OnCreateSoundFile()&lt;br /&gt;
        ' Desc: Called when the user requests to save to a sound file&lt;br /&gt;
        '-----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
        If Recording Then&lt;br /&gt;
            ' Stop the capture and read any data that &lt;br /&gt;
            ' was not caught by a notification&lt;br /&gt;
            StartOrStopRecord(False)&lt;br /&gt;
            Recording = False&lt;br /&gt;
        End If&lt;br /&gt;
&lt;br /&gt;
        ' Update the UI controls to show the sound as loading a file&lt;br /&gt;
        checkboxRecord.Enabled = False&lt;br /&gt;
        Try&lt;br /&gt;
            CreateRIFF()&lt;br /&gt;
        Catch&lt;br /&gt;
&lt;br /&gt;
        End Try&lt;br /&gt;
&lt;br /&gt;
        ' Update the UI controls to show the sound as the file is loaded&lt;br /&gt;
        labelFilename.Text = FileName&lt;br /&gt;
        checkboxRecord.Enabled = True&lt;br /&gt;
&lt;br /&gt;
        ' Remember the path for next time&lt;br /&gt;
        Path = FileName.Substring(0, FileName.LastIndexOf("\"))&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Above code corectly record sound from mic and saving into the wav, but both channels and I need to split then into two mono wav's. Can anyone help me?&lt;br /&gt;
pairs left channel, right channel, left...&lt;br /&gt;
I'm tired of unsuccessful attempts...&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
Schift&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/DirectSound/417333/417333/recording-mic-and-split-stereo-into-two-mono-wav/</guid>
      <pubDate>Sun, 20 Jun 2010 07:08:00 -0700</pubDate>
      <category>DirectSound</category>
    </item>
    <item>
      <title>This post has been deleted.</title>
      <link>http://www.programmersheaven.com/mb/DirectSound/417333/419032/this-post-has-been-deleted/#419032</link>
      <description>This post has been deleted.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/DirectSound/417333/419032/this-post-has-been-deleted/#419032</guid>
      <pubDate>Sat, 09 Oct 2010 02:24:24 -0700</pubDate>
      <category>DirectSound</category>
    </item>
    <item>
      <title>This post has been deleted.</title>
      <link>http://www.programmersheaven.com/mb/DirectSound/417333/419073/this-post-has-been-deleted/#419073</link>
      <description>This post has been deleted.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/DirectSound/417333/419073/this-post-has-been-deleted/#419073</guid>
      <pubDate>Tue, 12 Oct 2010 06:47:17 -0700</pubDate>
      <category>DirectSound</category>
    </item>
  </channel>
</rss>