Mercurial > rinkhals
diff data/sounds/get-sources @ 113:55105d3bdab1
Renamed fire-rifle to fire-machinegun, and added a single-shot rifle
Adjusted convert_audio so you can specify a converter, namely oggenc, as nothing else seems to handle fire-rifle.wav
author | David Fraser <davidf@sjsoft.com> |
---|---|
date | Wed, 02 Sep 2009 19:13:54 +0000 |
parents | 1fd56b625b24 |
children |
line wrap: on
line diff
--- a/data/sounds/get-sources Wed Sep 02 18:55:46 2009 +0000 +++ b/data/sounds/get-sources Wed Sep 02 19:13:54 2009 +0000 @@ -26,9 +26,12 @@ for section in source_config.sections(): yield section, dict(source_config.items(section)) -def convert_audio(source_filename, target_filename, source_format, target_format): +def convert_audio(source_filename, target_filename, source_format, target_format, converter=None): """converts audio between files""" logging.info("Converting %s (format %s) to %s (format %s)", source_filename, source_format, target_filename, target_format) + if converter == "oggenc": + subprocess.call(["oggenc", source_filename, "-o", target_filename]) + return if not acodec or not muxer: logging.debug("pymedia not present: will try use transcode") if source_format == "aiff": @@ -148,5 +151,6 @@ source_filename = download_filename orig_format = source_options.get("originalformat", orig_ext) target_format = source_options.get("targetformat", target_ext) - convert_audio(source_filename, target_filename, orig_format, target_format) + converter = source_options.get("converter", None) + convert_audio(source_filename, target_filename, orig_format, target_format, converter)