Beispiel #1
0
    def __init__(self, config):

        import sys

        try:
            self.codec = ffi.dlopen('./librtpsbc.so')
        except:
            print 'Exception:', sys.exc_info()[0]

        self.config = ffi.new('sbc_t *')
        self.ts = ffi.new('unsigned int *', 0)
        self.seq_num = ffi.new('unsigned int *', 0)
        self._init_sbc_config(config)
        self.codec.sbc_init(self.config, 0)
Beispiel #2
0
    def __init__(self, config):

        import sys

        so_path = './librtpsbc.so'
        if platform.machine() == 'aarch64':
            so_path = './librtpsbc_aarch64.so'

        try:
            self.codec = ffi.dlopen(so_path)
        except Exception as e:
            print('Exception:' + str(sys.exc_info()[0]))
            print(str(e))

        self.config = ffi.new('sbc_t *')
        self.ts = ffi.new('unsigned int *', 0)
        self.seq_num = ffi.new('unsigned int *', 0)
        self._init_sbc_config(config)
        self.codec.sbc_init(self.config, 0)