Question: I am looking for a way that I can combine multiple wave files into one wave file using python and run it on linux. I don't want to use any add on other than the default shell command line and default python modules. 
For example, if I have a.wav and b.wav. I want to create a c.wav which start with the content from a.wav then b.wav. 
I've found wave module, that I can open a wave file and write into a new file. Since i'm really new in this audio world. I still can't figure out how to do it. Below is my code

```
import struct, wave

waveFileA = wave.open('./a.wav', 'r')
waveFileB = wave.open('./b.wav', 'r')
waveFileC = wave.open('./c.wav', 'w')

lengthA = waveFileA.getnframes()
for i in range(0,lengthA):
    waveFileC.writeframes(waveFileA.readframes(1))

lengthB = waveFileB.getnframes()
for i in range(0,lengthB):
    waveFileC.writeframes(waveFileB.readframes(1))

waveFileA.close()
waveFileB.close()
waveFileC.close()

```

When i run this code, I got this error:

```
wave.Error: # channels not specified

```

Please can any one help me?

Answer: 
Looks like you need to call `n=waveFileA.getnchannels()` to find out how many channels the first input file uses, likewise for waveFileB, then you'll need to use `waveFileC.setnchannels(n)` to tell it how many channels to put in the outgoing file. I don't know how it will handle input files with different numbers of channels...
Here is the answer I am looking for

[How to join two wav files using python?](https://stackoverflow.com/questions/2890703/how-to-join-two-wav-file-using-python)
(look for a thread by Tom 10)

It's in another thread. some one already solved this problem.