| Reply | « Previous Thread | Next Thread » |
|
I am trying to write a simple answering machine in Python. However can't play a sound. The call is handled correctly.
audio.say doesn't say anything and s.play crashes Code:
import telephone
import e32
import audio
callstate=0
def playsound():
global s
s = audio.Sound.open('E:\\Sounds\\hello.mp3')
s.play()
e32.ao_sleep(1)
s.close()
def calla(event):
print event
global callstate
s=event[0]
if s==3:
print 'answering'
e32.ao_sleep(1)
telephone.answer()
callstate=3
telephone.incoming_call()
telephone.call_state(calla)
while True:
e32.ao_sleep(1)
if callstate==3:
callstate=99
audio.say('Hello')
playsound()
e32.ao_sleep(2)
telephone.hang_up()
app_lock = e32.Ao_lock()
app_lock.wait()
I saw a similiar question but couldn't find an answer. Is there any workaround? I am using E90 and Python 1.4.2 final. |
|
Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
Online
Forum Nokia Champion
|
|
Actually audio.say does say the word "Hello" but at a very low volume (I don't know why).
As for the crash when trying to play the sound, you used the variable name s for both event[0] and the sound file. Rename one of them and try again so it won't crash, but I don't think this will play the sound: I got KErrPermissionDenied, so playing a sound while a phone call is open probably conflicts with the OS's way of doing things (in this case it pauses sounds while the phone is ringing and a call is answered). |
|
From PythonForS60_doc_1_3_1.pdf
Quote:
But even when I run separate script during telephone call it doesn't play sound. |
|
Quote:
I tried this on my 6680 and it works fine, It is able to play the sound file during an ongoing call with low volume ofcourse as its playing to uplink. I will soon try this on E90 and let you know. Best Regards, Croozeus |
|
Curious!
I will try on E51. Maybe this problem is E90 related? That's sad. E90 is my primary device ![]() |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Recording in Amr Format | losym | Symbian Media (Graphics & Sounds) | 12 | 2009-03-26 07:41 |
| How to play simulataneously an audio clip and a tone | anand_zain76 | Symbian Media (Graphics & Sounds) | 2 | 2008-03-26 11:22 |
| The problem about the audio module of the game engine | vincent.lee | Symbian Media (Graphics & Sounds) | 2 | 2008-03-15 08:22 |
| Play WAV during call not to loud speaker | Bill_Murray | General Symbian C++ | 2 | 2006-01-26 00:44 |
| Does DRM prevent playing AMR audio in a call ? | berniw99 | Digital Rights Management & Content Downloading | 0 | 2005-10-25 11:37 |