File size: 715 Bytes
c71fb67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import argparse
from pydub import AudioSegment

# Create an argument parser
parser = argparse.ArgumentParser(description='Concatenate two WAV files.')
parser.add_argument('--wav1', type=str, required=True, help='Path to the first WAV file')
parser.add_argument('--wav2', type=str, required=True, help='Path to the second WAV file')
args = parser.parse_args()

# Load the audio files
audio1 = AudioSegment.from_wav(args.wav1)
audio2 = AudioSegment.from_wav(args.wav2)

# Concatenate the audio files
combined_audio = audio1 + audio2

# Export the concatenated audio to a new file
output_file = 'combined_audio.wav'
combined_audio.export(output_file, format="wav")

print(f"Concatenated audio saved as {output_file}")