I'm trying to create an multichannel audio file with Pydub but I received an error. I know that each channels should be the exact same length, but also the frame count. I don't know how to verify if they are at the same frame count but they are at the same size.
from pydub import AudioSegment
from pydub.playback import play
from playsound import playsound
left_channel = AudioSegment.from_wav("scripts_OUN\Single Cricket Chirping Effect.wav")
right_channel = AudioSegment.from_wav("scripts_OUN\d.wav")
left_channel_v2 = left_channel + AudioSegment.silent(duration=152009)
left = left_channel_v2.set_channels(1)
right = right_channel.set_channels(1)
print(len(left_channel_v2))
print(len(right_channel))
print(len(left_channel_v2)==len(right_channel))
print(left_channel.set_frame_rate
)
mutli_channel = AudioSegment.from_mono_audiosegments(left,right)
mutli_channel.export("v3.wav", format="wav")
My errors messages :
<bound method AudioSegment.set_frame_rate of <pydub.audio_segment.AudioSegment object at 0x000002ACB8076A40>>
and :
ValueError: attempt to assign array of size 12324755 to extended slice of size 12324781