Open Fear-MK opened 3 years ago
So far, I have never seen multichannel audio being used in PyDub. In fact, my very crude and basic eq
function relies on the fact that all files processed are Stereo or Mono and not multichannel. If multichannel audio is supported, I would have to change the design and pattern of that function a little.
Can anyone please confirm this? @jiaaro @ross @cghawthorne @shadchin @emyller
I knew you could mix down to 2 channels (from reading the readme), which gave me the impression you could somehow do the opposite, thought I may be wrong. If there was another library that made multichannel files that would be great too, but my lack of googling skills means I haven't found anything thus far.
Could you load them all as mono and combine from there?
# load individual channels... mutli_channel = AudioSegment.from_mono_audiosegments(channel1, channel2, ..., channel_n)
https://stackoverflow.com/questions/44920182/how-to-write-multi-channel-wav-file-in-python
This isn't much so an issue, but rather a question. How can I make a 4 channel (and above (6, 8 channels)) music file without the 3rd and 4th channel being blank?
def speed_change(speed): for file in filename_tracks: audio_input = filename_tracks[file]+"_amp.wav" audio_output = filename_tracks[file]+"_f.wav" sound = AudioSegment.from_file(audio_input) sound_with_altered_frame_rate = sound._spawn(sound.raw_data, overrides={ "frame_rate": int(sound.frame_rate * speed) }) speed_up = sound_with_altered_frame_rate.set_frame_rate(sound.frame_rate) if "STRM" in filename_tracks[file]: speed_up.export(audio_output, format="wav", parameters=["-ac", "4"]) else: speed_up.export(audio_output, format="wav")
This is the code being included at the moment, and currently it leaves channels 3 and 4 blank.