Categories: Python | S60 | Code Examples | How To
This page was last modified 06:27, 6 April 2008.
How to record a call
From Forum Nokia Wiki
The below code is used to record a call using Python.
import appuifw import e32 from key_codes import * import audio s = audio.Sound.open('C:\\data\\h.amr') class Keyboard(object): def __init__(self,onevent=lambda:None): self._keyboard_state={} self._downs={} self._onevent=onevent def handle_event(self,event): if event['type'] == appuifw.EEventKeyDown: code=event['scancode'] if not self.is_down(code): self._downs[code]=self._downs.get(code,0)+1 self._keyboard_state[code]=1 elif event['type'] == appuifw.EEventKeyUp: self._keyboard_state[event['scancode']]=0 self._onevent() def is_down(self,scancode): return self._keyboard_state.get(scancode,0) def pressed(self,scancode): if self._downs.get(scancode,0): self._downs[scancode]-=1 return True return False keyboard=Keyboard() def quit(): global running, s running=0 s.close() appuifw.app.set_exit() running=1 appuifw.app.screen='normal' canvas=appuifw.Canvas(event_callback=keyboard.handle_event, redraw_callback=None) appuifw.app.body=canvas appuifw.app.exit_key_handler=quit while running: if keyboard.pressed(EScancode2): s.play() appuifw.note(u"Playing", "info") #Start Playing if keyboard.pressed(EScancode3): s.stop() # Stop recording appuifw.note(u"Stopped", "info") #Stopped if keyboard.pressed(EScancode1): appuifw.note(u"Recording", "info") s.record() # Start recording e32.ao_yield()
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to Real Time Record Sound Data in Nokia3650? | havoc_walker | Symbian User Interface | 0 | 2003-03-19 14:32 |
| Help with recording | Drakyn | Python | 7 | 2007-01-04 21:32 |
| Checking call? | madsbjoern | Python | 7 | 2006-04-05 12:17 |
| Initializing Database? | rolloderwikinger | Mobile Java General | 1 | 2005-04-02 12:57 |
| recordstore to list | cks | Mobile Java General | 3 | 2006-11-28 09:50 |
