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

  • Home
  • SEARCH
  • 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 846599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:38:26+00:00 2026-05-15T06:38:26+00:00

I have written a code for joining two wave files.It works fine when i

  • 0

I have written a code for joining two wave files.It works fine when i am joining larger segments but as i need to join very small segments the clarity is not good.

I have learned that the signal processing technique such a windowed join can be used to improve the joining of file.

y[n] = w[n]s[n]
Multiply value of signal at sample number n by the value of a windowing function
hamming window w[n]= .54 – .46*cos(2*Pi*n)/L 0

I am not understanding how to get the value to signal at sample n and how to implement this??

the code i am using for joining is

import wave
m=['C:/begpython/S0001_0002.wav', 'C:/begpython/S0001_0001.wav']
i=1
a=m[i]
infiles = [a, "C:/begpython/S0001_0002.wav", a]
outfile = "C:/begpython/S0001_00367.wav"

data= []
data1=[]
for infile in infiles:
    w = wave.open(infile, 'rb')
    data1=[w.getnframes]
    data.append( [w.getparams(), w.readframes(w.getnframes())] )
    #data1 = [ord(character) for character in data1]

    #print data1
    #data1 = ''.join(chr(character) for character in data1)

    w.close()

output = wave.open(outfile, 'wb')
output.setparams(data[0][0])
output.writeframes(data[0][1])
output.writeframes(data[1][1])
output.writeframes(data[2][1])
output.close()

during joining i am manipulating using byte format for frames.now have to use integer or float format to perform operation on them i guess,if what i am thinking is true,how can i do 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-05-15T06:38:27+00:00Added an answer on May 15, 2026 at 6:38 am

    It’s probably not the best solution, but I’m sure it will work. Maybe you find existing libs or so for some steps, I dont know for Python. The steps I suggest are:

    1. Load the wave file.
    2. Create the sample values (amplitude)
      for each frame (depending on frame
      size, litte/big endian,
      signed/unsigned).
    3. Divide the resulting array of int
      values into windows, e.g. sample
      0-511, 512-1023, …
    4. Perform the window function, for the
      windows that you want to join.
    5. Do your joining.
    6. Store the windows back in a byte
      array, the inverse operation of the
      first step.

    Old Post:
    You have to calculate the sample value, in java a function for a 2 byte/frame soundfile would look like this:

    public static int createIntFrom16( byte _8Bit1, byte _8Bit2 ) {
        return ( 8Bit1<<8 ) | ( 8Bit2 &0x00FF );
    }
    

    Normally you will have to care about whether or not the file uses little endian, I don’t know if the Python lib will take this into account.

    Once you have created all sample values, you have to divide your file into windows, e.g. of size 512 samples. Then you can window the values, and create back the byte values. For 16bit it would look like this:

    public static byte[] createBytesFromInt(int i) {
        byte[] bytes = new byte[2];
        bytes[0]=(byte)(i>>8);
        bytes[1]=(byte)i;
        return bytes;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 418k
  • Answers 418k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer May be the library NDepend.Helpers.FileDirectoryPath is what you are looking… May 15, 2026 at 9:57 am
  • Editorial Team
    Editorial Team added an answer Have you tried calling [cell setNeedsDisplay] but on the main… May 15, 2026 at 9:57 am
  • Editorial Team
    Editorial Team added an answer If you look at the revision logs of that file… May 15, 2026 at 9:57 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.