python - Using FFMPEG to convert Numpy text file to mp3 -


i have text file contains output of numpy array , use ffmpeg convert mp3 file.

i've been following this tutorial, , put in perspective have written audio_array created text file, read later on in program ffmpeg , convert mp3 file.

i tried modifying part below follows, doesn't seem give me output:

pipe = sp.popen([ ffmpeg_bin, '-y', # (optional) means overwrite output file if exists. "-f", 's16le', # means 16bit input "-acodec", "pcm_s16le", # means raw 16bit input '-r', "44100", # input have 44100 hz '-ac','2', # input have 2 channels (stereo) '-i', '[path/to/my/text_file.txt]', '-vn', # means "don't expect video input" '-acodec', "libfdk_aac" # output audio codec '-b', "3000k", # output bitrate (=quality). here, 3000kb/second 'my_awesome_output_audio_file.mp3'], stdin=sp.pipe,stdout=sp.pipe, stderr=sp.pipe)


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -