From: W. Trevor King Date: Thu, 10 Nov 2011 19:57:01 +0000 (-0500) Subject: Add 'wav' source and drop 'tflt' id3 tags in mkogg.py. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=78ac1d06d896a7c83af8326f0edb550a2366606f;p=mw2txt.git Add 'wav' source and drop 'tflt' id3 tags in mkogg.py. --- diff --git a/posts/mkogg/mkogg.py b/posts/mkogg/mkogg.py index cdd22a0..a518ea3 100755 --- a/posts/mkogg/mkogg.py +++ b/posts/mkogg/mkogg.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright (C) 2009-2010 W. Trevor King +# Copyright (C) 2009-2011 W. Trevor King # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as @@ -81,7 +81,7 @@ class Converter (object): cache_file=None): self.source_dir = source_dir self.target_dir = target_dir - self._source_extensions = ['flac', 'mp3', 'ogg'] + self._source_extensions = ['flac', 'mp3', 'ogg', 'wav'] self._target_extension = target_extension self._cache_file = cache_file self._cache = self._read_cache() @@ -269,6 +269,7 @@ class Converter (object): 'pcnt', # play counter (incremented with each play) 'priv', # private 'tenc', # encoded by + 'tflt', # file type 'tope', # original artist (e.g. for a cover) 'tlen', # length (in milliseconds) 'tmed', # media type @@ -387,6 +388,9 @@ class Converter (object): ['vorbiscomment', '--list', source]) return self._parse_vorbis_comments(stdout) + def get_wav_metadata(self, source): + return {} + def set_flac_metadata(self, target, metadata): stdin = '\n'.join(['%s=%s' % (k.upper(), v) for k,v in sorted(metadata.iteritems())]) @@ -426,6 +430,9 @@ class Converter (object): for k,v in sorted(metadata.iteritems())]) invoke(['vorbiscomment', '--write', target], stdin=stdin) + def set_wav_metadata(self, target, metadata): + pass + def test(): import doctest