audio.py 文件源码

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

项目:core-framework 作者: RedhawkSDR 项目源码 文件源码
def _getCaps(self):
        bits = struct.calcsize(self.datatype) * 8
        if self.datatype in ('f', 'd'):
            return gst.Caps('audio/x-raw-float,endianness=%s,width=%d,rate=%d,channels=1' % (self.ENDIANNESS, bits, self.sample_rate))
        else:
            # In struct module, unsigned types are uppercase, signed are lower
            if self.datatype.isupper():
                signed = 'false'
            else:
                signed = 'true'
            return gst.Caps('audio/x-raw-int,endianness=%s,signed=%s,width=%d,depth=%d,rate=%d,channels=1' % (self.ENDIANNESS, signed, bits, bits, self.sample_rate))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号