×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    12

    Can't play audio during call

    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.

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: Can't play audio during call

    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).

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    12

    Re: Can't play audio during call

    From PythonForS60_doc_1_3_1.pdf

    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.

  4. #4
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,800

    Re: Can't play audio during call

    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
    Pankaj Nathani
    www.croozeus.com

  5. #5
    Registered User
    Join Date
    Apr 2008
    Posts
    12

    Re: Can't play audio during call

    Curious!
    I will try on E51. Maybe this problem is E90 related?
    That's sad. E90 is my primary device

Similar Threads

  1. Recording in Amr Format
    By losym in forum Symbian Media (Closed)
    Replies: 12
    Last Post: 2009-03-26, 06:41
  2. How to play simulataneously an audio clip and a tone
    By anand_zain76 in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2008-03-26, 10:22
  3. The problem about the audio module of the game engine
    By vincent.lee in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2008-03-15, 07:22
  4. Play WAV during call not to loud speaker
    By Bill_Murray in forum Symbian
    Replies: 2
    Last Post: 2006-01-25, 23:44
  5. Does DRM prevent playing AMR audio in a call ?
    By berniw99 in forum Digital Rights Management & Content Downloading
    Replies: 0
    Last Post: 2005-10-25, 10:37

Posting Permissions

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