audio.py 文件源码

python
阅读 38 收藏 0 点赞 0 评论 0

项目:zignal 作者: ronnyandersson 项目源码 文件源码
def __str__(self):
        s  = '=======================================\n'
        s += 'classname        : %s\n'          %self.__class__.__name__
        s += 'sample rate      : %.1f [Hz]\n'   %self.fs
        s += 'channels         : %i\n'          %self.ch
        s += 'duration         : %.3f [s]\n'    %self.duration
        s += 'datatype         : %s\n'          %self.samples.dtype
        s += 'samples per ch   : %i\n'          %self.nofsamples
        s += 'data size        : %.3f [Mb]\n'   %(self.samples.nbytes/(1024*1024))
        s += 'has comment      : %s\n'          %('yes' if len(self._comment)!=0 else 'no')
        if self.ch != 0:
            # += '-----------------:---------------------\n'
            s += 'peak             : %s\n'  %np.array_str(self.peak()[0],
                                                          precision=4, suppress_small=True)
            s += 'RMS              : %s\n'  %np.array_str(self.rms(),
                                                          precision=4, suppress_small=True)
            s += 'crestfactor      : %s\n'  %np.array_str(self.crest_factor(),
                                                          precision=4, suppress_small=True)
        s += '-----------------:---------------------\n'
        return s
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号