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

AudioFileReader copyto progress

Apr 11, 2014 at 7:47 PM
How would I be able to update a progress bar if I am copying a wav file to a mp3 file

I use the following code to copy the file and it works perfectly I just want to be able to show the progress of the copy to the enduser
        using (reader = new AudioFileReader(FilenameTextBox.Text))
        {
            reader.Volume = VolumeTrackBar.Value * 0.5f;
            using (LameMP3FileWriter writer = new LameMP3FileWriter(string.Format(@"{0}\{1}.mp3", DestDirTextBox.Text, SermonTextBox.Text), reader.WaveFormat, 128))
            {
                reader.CopyTo(writer);
            }
        }
Apr 11, 2014 at 10:05 PM
I'd recommend not to use CopyTo and just create a buffer and copy a few seconds at a time. Then you can update your process bar in the loop.