Added audio sampling and audio bitrate properties
authorThierry Florac <thierry.florac@onf.fr>
Tue, 08 Sep 2015 16:30:58 +0200
changeset 4 36c3db8c50a4
parent 3 4fe9ea97da5a
child 5 73e9b218db71
Added audio sampling and audio bitrate properties
src/pyams_media/interfaces/__init__.py
src/pyams_media/utility.py
--- a/src/pyams_media/interfaces/__init__.py	Tue Sep 08 16:22:46 2015 +0200
+++ b/src/pyams_media/interfaces/__init__.py	Tue Sep 08 16:30:58 2015 +0200
@@ -197,6 +197,14 @@
                          value_type=Choice(vocabulary="PyAMS media audio converters"),
                          required=False)
 
+    audio_sampling = Int(title=_("Audio frequency"),
+                         description=_("A common value is 22050. Leave empty to keep original value."),
+                         required=False)
+
+    audio_bitrate = Int(title=_("Audio bitrate"),
+                        description=_("In kilo-bytes per second. Leave empty to keep original value."),
+                        required=False)
+
     def check_media_conversion(self, media):
         """Check if conversion is needed for given media"""
 
--- a/src/pyams_media/utility.py	Tue Sep 08 16:22:46 2015 +0200
+++ b/src/pyams_media/utility.py	Tue Sep 08 16:30:58 2015 +0200
@@ -44,6 +44,8 @@
     video_quantisation = FieldProperty(IMediaConversionUtility['video_quantisation'])
 
     audio_formats = FieldProperty(IMediaConversionUtility['audio_formats'])
+    audio_sampling = FieldProperty(IMediaConversionUtility['audio_sampling'])
+    audio_bitrate = FieldProperty(IMediaConversionUtility['audio_bitrate'])
 
     def check_media_conversion(self, media):
         """Check if conversion is needed for given media"""