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 8222513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:18:27+00:00 2026-06-07T14:18:27+00:00

I’m writing my WAVE decoder/encoder in C++. I’ve managed to correctly convert between different

  • 0

I’m writing my WAVE decoder/encoder in C++. I’ve managed to correctly convert between different sample sizes (8, 16 and 32), but I need some help with the channels and the frequency.

Channels:

If I want to convert from stereo to mono:

  1. do I just take the data from one channel (which one? 1 or 2?)?
  2. or do I take the average from channel 1 and 2 for the mono channel.

If I want to convert from mono to stereo:
(I know this is not very scientific)

  1. can I simply add the samples from the single channels into both the stereo channels?
  2. is there a more scientific method to do this (eg: interpolation)?

Sample rate:

How do I change the sample rate (resample), eg: from 44100 Hz to 22050 Hz:

  1. do I simply take the average of 2 sequential samples for the new (lower frequency) value?
  2. Any more scientific algorithms for this?
  • 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-06-07T14:18:29+00:00Added an answer on June 7, 2026 at 2:18 pm
    • Stereo to mono – take the mean of the left and right samples, i.e. M = (L + R) / 2 – this works for the vast majority of stereo content, but note that there are some rare cases where you can get left/right cancellation.

    • Mono to stereo – put the mono sample in both left and right channels, i.e. L = R = M – this gives a sound image which is centered when played as stereo

    • Resampling – for a simple integer ratio downsampling as in your example above, the process is:

      • low pass filter to accommodate new Nyquist frequency, e.g. 10 kHz LPF for 22.05 kHz sample rate
      • decimate by required ratio (i.e. drop alternate samples for your 2x downsampling example)

    Note that there are third party libraries such as libsamplerate which can handle resampling for you in the general case, so if you have more than one ratio you need to support, or you have some tricky non-integer ratio, then this might be a better approach

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.