-1

I need to change the order of channels in .wav file. for example if .wav file contains 16 channel like

"0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"

then need to change this order to

"13 14 15 0 1 2 3 4 5 6 7 8 9 10 11 12"

using any python module.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Varada
  • 736
  • 7
  • 17
  • 1
    Did you try anything? – TDG Jul 19 '19 at 07:13
  • using > FFmpeg command to map the channel. "" $ffmpeg -i -af "channelmap=13|14|15|0|1|2|3|4|5|6|7|8|9|10|11|12" -c:a "" calling this in subprocess.Popen – Varada Jul 22 '19 at 06:44

1 Answers1

0
import subprocess

cmd = 'ffmpeg -i tdm2_no_ch_map_1.wav -af "channelmap=13|14|15|0|1|2|3|4|5|6|7|8|9|10|11|12" -c:a pcm_s32le out.wav'

cmd = subprocess.Popen(cmd)  # , stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
out, err = cmd.communicate()
print(err)

Prerequisites: ffmpeg - https://m.wikihow.com/Install-FFmpeg-on-Windows#step_2_1

Note: tested this code on windows machine

Varada
  • 736
  • 7
  • 17