Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6128829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:40:17+00:00 2026-05-23T16:40:17+00:00

I want to change a WAV file to 8KHz and 8bit using NAudio. WaveFormat

  • 0

I want to change a WAV file to 8KHz and 8bit using NAudio.

            WaveFormat format1 = new WaveFormat(8000, 8, 1);
            byte[] waveByte = HelperClass.ReadFully(File.OpenRead(wavFile));
            Wave
            using (WaveFileWriter writer = new WaveFileWriter(outputFile, format1))
            {
                writer.WriteData(waveByte, 0, waveByte.Length);
            }

but when I play the output file, the sound is only sizzle. Is my code is correct or what is wrong?

If I set WaveFormat to WaveFormat(44100, 16, 1), it works fine.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:40:18+00:00Added an answer on May 23, 2026 at 4:40 pm

    A few pointers:

    • You need to use a WaveFormatConversionStream to actually convert from one sample rate / bit depth to another – you are just putting the original audio into the new file with the wrong wave format.
    • You may also need to convert in two steps – first changing the sample rate, then changing the bit depth / channel count. This is because the underlying ACM codecs can’t always do the conversion you want in a single step.
    • You should use WaveFileReader to read your input file – you only want the actual audio data part of the file to get converted, but you are currently copying everything including the RIFF chunks as though they were audio data into the new file.
    • 8 bit PCM audio usually sounds horrible. Use 16 bit, or if you must have 8 bit, use G.711 u-law or a-law
    • Downsampling audio can result in aliasing. To do it well you need to implement a low-pass filter first. This unfortunately isn’t easy, but there are sites that help you generate the coefficients for a Chebyshev low pass filter for the specific downsampling you are doing.

    Here’s some example code showing how to convert from one format to another. Remember that you might need to do the conversion in multiple steps depending on the format of your input file:

    using (var reader = new WaveFileReader("input.wav"))
    {
        var newFormat = new WaveFormat(8000, 16, 1); 
        using (var conversionStream = new WaveFormatConversionStream(newFormat, reader))
        {
            WaveFileWriter.CreateWaveFile("output.wav", conversionStream);
        } 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to change content of a Button in XAML using a DataTrigger. Conditionally
I have a url of the wav file http://xyz.com/recordings/employees/test.wav What i want to know
I want to change an audio file format into another. Specifically, I want to
I want to play a short sound file(e.g. mp3,wav).How to play short sounds while
I want to change the src attribute of a tag using javascript and a
I want change my class=value on select option using jQuery Example <select name=color_scheme id=color_scheme>
I am new to iphone. I want change the view from portrait to landscape
I implemented the Line graph using the achartengine. But i want change the line
hallo I want to play wav file in my WPF application when app detects
i want change the content of a UITableView when i change a button, how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.