You Are Here:

Community: Developer Discussion Boards

#1 Old Can't play audio during call - 2008-05-14, 17:08

Join Date: Apr 2008
Posts: 12
pantomas
Offline
Registered User
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.
Reply With Quote

#2 Old Re: Can't play audio during call - 2008-05-14, 18:03

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
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).
Reply With Quote

#3 Old Re: Can't play audio during call - 2008-05-15, 00:01

Join Date: Apr 2008
Posts: 12
pantomas
Offline
Registered User
From PythonForS60_doc_1_3_1.pdf

Quote:
Calling play while a telephone call is ongoing plays the sound file to uplink. In some
devices the sound file is also played to the device speaker.
So this is what an official documantation says.
But even when I run separate script during telephone call it doesn't play sound.
Reply With Quote

#4 Old Re: Can't play audio during call - 2008-05-15, 05:55

Join Date: May 2007
Posts: 2,737
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Quote:
Originally Posted by pantomas View Post
From PythonForS60_doc_1_3_1.pdf



So this is what an official documantation says.
But even when I run separate script during telephone call it doesn't play sound.
Hi pantomas,

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
Reply With Quote

#5 Old Re: Can't play audio during call - 2008-05-15, 23:50

Join Date: Apr 2008
Posts: 12
pantomas
Offline
Registered User
Curious!
I will try on E51. Maybe this problem is E90 related?
That's sad. E90 is my primary device
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
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

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d81449X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZpythonQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZuserE5ftagQSxpythonX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ