'Mix at position audio files NAudio

I'd like to mix some audio files at a specific position.

In example i have a musical base and I want to overlay a speech at a certain time position (the theme starts and then after 3 seconds i want to have my voice on) and than export to a wave file.

For now i can mix several audio files but starting all at the same time with this: element is the object containing the filname of the audio samples

    Dim audioReaders As New List(Of Wave.AudioFileReader)
    For Each element In elements
        Dim myReader As New NAudio.Wave.AudioFileReader(element.Filename)
        audioReaders.Add(myReader)
    Next

    Dim mixer As New NAudio.Wave.SampleProviders.MixingSampleProvider(audioReaders)

    NAudio.Wave.WaveFileWriter.CreateWaveFile16("mixed.wav", mixer)

How can i do it using Naudio in vb.net?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source