source: telemeta/analysis/dc.py @ 8aa0ef8

cremcrem2devdev2diademsdj1.6feature/breadcrumbsfeature/ts-0.5feature/ts-0.5.4feature/writecacheformagenericinstru_searchlamlam2mapsv3mergenlivemultiproductionrelease/1.4.4sabiodsecurityserversocialstoragetelecastertestvideo
Last change on this file since 8aa0ef8 was 8aa0ef8, checked in by yomguy <>, 6 years ago

add Mean DC shift analyzer, fix duration analysis, cleanup

  • Property mode set to 100644
File size: 878 bytes
Line 
1# Copyright (C) 2008 Parisson SARL
2# All rights reserved.
3#
4# This software is licensed as described in the file COPYING, which
5# you should have received as part of this distribution. The terms
6# are also available at http://svn.parisson.org/telemeta/TelemetaLicense.
7#
8# Author: Guillaume Pellerin <yomguy@parisson.com>
9
10from telemeta.analysis.core import *
11from telemeta.analysis.api import IMediaItemAnalyzer
12import numpy
13
14class MeanDCShiftAnalyser(AudioProcessor):
15    """Media item analyzer driver interface"""
16
17    implements(IMediaItemAnalyzer)
18
19    def get_id(self):
20        return "dc"
21
22    def get_name(self):
23        return "Mean DC shift"
24
25    def get_unit(self):
26        return "%"
27
28    def render(self, media_item, options=None):
29        self.pre_process(media_item)
30        samples = self.get_mono_samples()
31        return numpy.round(100*numpy.mean(samples),4)
Note: See TracBrowser for help on using the repository browser.