I am trying to use create a recorder object with the python API of PJSUA.
I must admit I am stumped. I took the call.py in the example python tutorials:
http://trac.pjsip.org/repos/browser/pjproject/trunk/pjsip-apps/src/python/samples/call.py
I tried to add this to the main try body after lib.start(),
rec = lib.create_recorder(self, "/home/user1/Desktop/a.wav" ) # this is what is causing the trouble
rec1 = lib.recorder_get_slot(self, rec )
but Eclipse is complaining about “Lexical error at line 81, column 13. Encountered:”\u200b” (8203) after : “”
I then added
pj.Lib.instance().conf_connect(call_slot, lib.recorder_get_slot(self, rec))
inside the on_media_state method inside the MyCallCallback class.
I tried the solution here, but at least at first taught there are no strange characters randomly appearing.
What am I doing wrong? and what exactly is a lexical error in this context?
The reference to
\u200bsounds like it means Unicode characterU+200B ZERO WIDTH SPACE. This is not a usual character to find in Python language source code.Do you use any keyboards or input methods for non-European languages? Then you might have accidentally typed or pasted in text with a zero width space.
Try this: carefully set your input system to English or a European language. Re-type line 81. Then delete all of old line 81. By doing this, you eliminate the Zero Width Space, and replace it by Python source code which does what you intended.