Nathan Hjelm
2009-03-05 21:00:06 UTC
I find that adjustwavfilevolume is horribly slow on my macbook pro so
I propose we change it to use ffmpeg -vol. This change will require a
new build off ffmpeg for each platform (I have a universal binary for
macos x ready). The speed increase is more than an order of magnitude
(it took around 60 seconds to start playing a 260 second song with the
old routine and it now takes about a second).
Here is the updated routine:
def adjustwavfilevolume(wavfilename, gain):
""" Ajdust the volume of a wav file.
"""
temp_name=common.gettempfilename("wav")
ffmpeg=gethelperbinary ("ffmpeg")
run(ffmpeg, "-i", wavfilename, "-vol", `int(pow(10.0, gain/10.0)
* 256.0)`, temp_name)
os.remove(wavfilename)
os.rename(temp_name, wavfilename)
Additionally, since I want to add support for mpeg4 (AAC audio)
ringtones support since all new phone models support them (I have
already finished the code). AAC sounds better than mp3 at comparable
bitrates. AAC support requires that the new build of ffmpeg has
support for libfaac and libfaad.
Any comments?
-Nathan Hjelm
I propose we change it to use ffmpeg -vol. This change will require a
new build off ffmpeg for each platform (I have a universal binary for
macos x ready). The speed increase is more than an order of magnitude
(it took around 60 seconds to start playing a 260 second song with the
old routine and it now takes about a second).
Here is the updated routine:
def adjustwavfilevolume(wavfilename, gain):
""" Ajdust the volume of a wav file.
"""
temp_name=common.gettempfilename("wav")
ffmpeg=gethelperbinary ("ffmpeg")
run(ffmpeg, "-i", wavfilename, "-vol", `int(pow(10.0, gain/10.0)
* 256.0)`, temp_name)
os.remove(wavfilename)
os.rename(temp_name, wavfilename)
Additionally, since I want to add support for mpeg4 (AAC audio)
ringtones support since all new phone models support them (I have
already finished the code). AAC sounds better than mp3 at comparable
bitrates. AAC support requires that the new build of ffmpeg has
support for libfaac and libfaad.
Any comments?
-Nathan Hjelm