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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:00:57+00:00 2026-05-30T04:00:57+00:00

I’m doing the following in VS2010 manually. 1. Read in 2 wave files, say

  • 0

I’m doing the following in VS2010 manually.
1. Read in 2 wave files, say “1.wav” and “2.wav”.
2. Insert 2.wav to the middle of 1.wav.
3. Write the result wave stream to an output file “out.wav”.

I can now read in the wave files successfully using the following structure

typedef struct {
    char ChunkID[4];        /* RIFF Header      */ //Magic header
    unsigned long ChunkSize;      /* RIFF Chunk Size  */
    char Format[4];        /* WAVE Header      */
    char Subchunk1ID[4];         /* FMT header       */
    unsigned long Subchunk1Size;  /* Size of the fmt chunk                                */
    unsigned short AudioFormat;    /* Audio format 1=PCM,6=mulaw,7=alaw, 257=IBM Mu-Law, 258=IBM A-Law, 259=ADPCM */
    unsigned short NumChannels;      /* Number of channels 1=Mono 2=Sterio                   */
    unsigned long SampleRate;  /* Sampling Frequency in Hz                             */
    unsigned long ByteRate;    /* bytes per second */
    unsigned short BlockAlign;     /* 2=16-bit mono, 4=16-bit stereo */
    unsigned short BitsPerSample;  /* Number of bits per sample      */
    char Subchunk2ID[4]; /* "data"  string   */
    unsigned long Subchunk2Size;  /* Sampled data length    */
    BYTE Data[18000];
} WavFile;

But some of the parameters of the 2 wave files are not the same. For example, if SampleRate of 1.wav is 8000, SampleRate of 2.wav is 44100, what will SampleRate of out.wav be?

  • 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-30T04:00:59+00:00Added an answer on May 30, 2026 at 4:00 am

    The sampling rate of out.wav is something that you will have to define explicitly. In your example, you could choose your out.wav to be 44100, the better of the two, but you will need to upsample 1.wav by interpolation or adding zeros in between. Alternatively, you could keep it at 8000 and downsample 2.wav by running it through a low-pass filter to filter out frequencies more than Nyquist (half of new sampling rate)and then dropping the samples in the middle. Eitherway, you will have to explicitly decide what you want to do.

    More info – https://ccrma.stanford.edu/~jos/resample/

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have thousands of HTML files to process using Groovy/Java and I need to
I have a bunch of posts stored in text files formatted in yaml/textile (from
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am trying to understand how to use SyndicationItem to display feed which is

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.