def _execute_sox_cmd(self, cmd, console_output=False):
on_windows = platform.system().lower() == "<STR_LIT>"<EOL>def _get_random_tmp_file():<EOL><INDENT>if on_windows:<EOL><INDENT>rand_string = "<STR_LIT>".join(random.choice(string.ascii_uppercase + string.digits) for _ in range(<NUM_LIT:8>))<EOL>tmp = self.name + "<STR_LIT:_>" + rand_string<EOL>WinTempFile = collections.namedtuple("<STR_LIT>", "<STR_LIT:name>")<EOL>tmp = WinTempFile(tmp)<EOL><DEDENT>else:<EOL><INDENT>tmp = tempfile.NamedTemporaryFile()<EOL><DEDENT>return tmp<EOL><DEDENT>tmp = _get_random_tmp_file()<EOL>othertmp = _get_random_tmp_file()<EOL>self.export(tmp.name, format="<STR_LIT>")<EOL>stdout = stderr = subprocess.PIPE if console_output else subprocess.DEVNULL<EOL>command = cmd.format(inputfile=tmp.name, outputfile=othertmp.name)<EOL>res = subprocess.call(command.split('<STR_LIT:U+0020>'), stdout=stdout, stderr=stderr)<EOL>assert res == <NUM_LIT:0>, "<STR_LIT>"<EOL>other = AudioSegment(pydub.AudioSegment.from_wav(othertmp.name), self.name)<EOL>if on_windows:<EOL><INDENT>os.remove(tmp.name)<EOL>os.remove(othertmp.name)<EOL><DEDENT>else:<EOL><INDENT>tmp.close()<EOL>othertmp.close()<EOL><DEDENT>return other<EOL>
Executes a Sox command in a platform-independent manner.

`cmd` must be a format string that includes {inputfile} and {outputfile}.