cremcrem2devdev2diademsformagenericinstru_searchlamnlivemultiproductionrelease/1.4.4securitysocialstoragetestvideo
|
Last change
on this file since 8aa0ef8 was
8aa0ef8,
checked in by yomguy <>, 4 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 | |
|---|
| 10 | from telemeta.analysis.core import * |
|---|
| 11 | from telemeta.analysis.api import IMediaItemAnalyzer |
|---|
| 12 | import numpy |
|---|
| 13 | |
|---|
| 14 | class 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.