I am using a python AGI script to make .flac
sound files from ‘.mp3’ but there is some unwanted clipping.
I have used ffmpeg
:
ffmpeg -i path/to/audio.mp3 path/to/audio.flac
and in python AGI:
import subprocess
subprocess.call(['ffmpeg', '-i', 'path/to/audio.mp3', 'path/to/audio.flac'])
There seems to be a difference in the duration of the output files (also the content)
I am checking the duration like:
ffmpeg -i /path/to/audio.extn 2>&1
The output for .mp3
(source) is
Duration: 00:00:06.45, start: 0.000000, bitrate: 48 kb/s
Stream #0:0: Audio: mp3, 22050 Hz, mono, s16p, 48 kb/s
Output for .flac
generated via agi:
Duration: 00:00:06.14, start: 0.000000, bitrate: 181 kb/s
Stream #0:0: Audio: flac, 20000 Hz, mono, s16
Output for `.flac’ generated by running the same python code in shell:
Duration: 00:00:06.45, start: 0.000000, bitrate: 191 kb/s
Stream #0:0: Audio: flac, 22050 Hz, mono, s16
I have tried changing the bit-rate, sampling-rate to no avail.
Any hint regarding what could be going wrong would help me a great deal.