Can't create recorder using python bindings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm working with python 3 + pjsip version 2.7.2 downloaded from here:

http://www.pjsip.org/release/2.7.2/pjproject-2.7.2.tar.bz2

And I'm currently able to establish calls with success and send audio using the AudioMediaPlayer, but when I tried to record the received audio using the AudioMediaRecorder I simply cant instantiate it, the following code:

import pjsua2 as pj

recorder = pj.AudioMediaRecorder()
recorder.createRecorder("test.wav")

Results in:

Traceback (most recent call last):
  File "error.py", line 4, in <module>
    recorder.createRecorder("test.wav")
  File "/root/.local/lib/python3.6/site-packages/pjsua2.py", line 3937, in createRecorder
    return _pjsua2.AudioMediaRecorder_createRecorder(self, file_name, enc_type, max_size, options)
NotImplementedError: Wrong number or type of arguments for overloaded function 'AudioMediaRecorder_createRecorder'.
  Possible C/C++ prototypes are:
    pj::AudioMediaRecorder::createRecorder(pj::string const &,unsigned int,pj_ssize_t,unsigned int)
    pj::AudioMediaRecorder::createRecorder(pj::string const &,unsigned int,pj_ssize_t)
    pj::AudioMediaRecorder::createRecorder(pj::string const &,unsigned int)
    pj::AudioMediaRecorder::createRecorder(pj::string const &)

I can see clearly a compatible function that receives just a string. Anyway I tried passing the other arguments like this:

import pjsua2 as pj

enc_type = 0
max_size = -1
options = pj.PJMEDIA_FILE_WRITE_PCM

recorder = pj.AudioMediaRecorder()
recorder.createRecorder("test.wav", enc_type, max_size, options)

And I get a similar error:

File "error.py", line 8, in <module>
    recorder.createRecorder("test.wav", enc_type, max_size, options)
  File "/root/.local/lib/python3.6/site-packages/pjsua2.py", line 3937, in createRecorder
    return _pjsua2.AudioMediaRecorder_createRecorder(self, file_name, enc_type, max_size, options)
NotImplementedError: Wrong number or type of arguments for overloaded function 'AudioMediaRecorder_createRecorder'.
  Possible C/C++ prototypes are:
    pj::AudioMediaRecorder::createRecorder(pj::string const &,unsigned int,pj_ssize_t,unsigned int)
    pj::AudioMediaRecorder::createRecorder(pj::string const &,unsigned int,pj_ssize_t)
    pj::AudioMediaRecorder::createRecorder(pj::string const &,unsigned int)
    pj::AudioMediaRecorder::createRecorder(pj::string const &)

I searched the project for an example on how to use the createRecorder method but was unable to find any. Any help will be greatly appreciated.

Best regards,
Katcipis


_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux