Audio support now creates OGG instead of WAV
authorJoar Wandborg <git@wandborg.com>
Sat, 11 Aug 2012 23:57:00 +0000 (01:57 +0200)
committerJoar Wandborg <git@wandborg.com>
Sat, 11 Aug 2012 23:57:00 +0000 (01:57 +0200)
While creating the spectrogram, and alternative version of the audio
file has been needed. Before this, it has been a WAV format file, the
issue with WAV is that it takes a lot of space. Starting with this it
will be an OGG file.

Rejoice :)

mediagoblin/media_types/audio/processing.py

index 18edbf1af37796f3a31c3c051c9c1e67019412c9..fada083fd42c502737044cea2a5373e7d9f6ce7a 100644 (file)
@@ -99,12 +99,13 @@ def process_audio(entry):
                 original=os.path.splitext(
                     queued_filepath[-1])[0]))
 
-        with tempfile.NamedTemporaryFile(suffix='.wav') as wav_tmp:
-            _log.info('Creating WAV source for spectrogram')
+        with tempfile.NamedTemporaryFile(suffix='.ogg') as wav_tmp:
+            _log.info('Creating OGG source for spectrogram')
             transcoder.transcode(
                 queued_filename,
                 wav_tmp.name,
-                mux_string='wavenc')
+                mux_string='vorbisenc quality={0} ! oggmux'.format(
+                    audio_config['quality']))
 
             thumbnailer = AudioThumbnailer()