This project has moved and is read-only. For the latest updates, please go here.

Naudio Trimmer many Trims to one file

Apr 28, 2013 at 12:28 AM
I have utilized the naudio library (I'm very impressed by the way and happy it exists) in a program I am writing that records the start time that a person makes an error and the stop time after the explanation of their error. I have been successful mat taking each error with respective start and stop times and create file a for each. I now have to do one or two things. Concatinate these files, which I have had a difficult time with, or write all the errors to one file after all the trims (appends all of them in one files if you will. Do you have any suggestions on how I could do this. I have little experience in but am using 2010. The trim code I am using I extracted WavefileUtils.vb from the voicerecorder download ( version).Is there a way to write these bytes to a file and loop til done and save the file? Thanks John
Apr 28, 2013 at 6:36 PM
to concatenate WAV files with NAudio, look at my answer here.
Apr 28, 2013 at 6:49 PM
I'll check it out Thanks A lot
Apr 28, 2013 at 7:47 PM
Hi Mark,

I have converted the code for the concatenator but I am an old vb6 man but am trying to tackle after many years.I am not sure how to introduce the input files. Could you be so kind as to affer a suggestion?

Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
    Concatenate("c:\one\out.wav", "c:\one\1.wav,2.wav")

End Sub
Public Shared Sub Concatenate(outputFile As String, sourceFiles As IEnumerable(Of String))
    Dim buffer As Byte() = New Byte(1023) {}
    Dim waveFileWriter As WaveFileWriter = Nothing

        For Each sourceFile As String In sourceFiles
            Using reader As New WaveFileReader(sourceFile)
Apr 28, 2013 at 9:01 PM
Hi Mark,

Nevermind, I got it. I just did an array called sourcefile. Thank you so much.