You Are Here:

Community: Developer Discussion Boards

#1 Old Unable to play audio files - 2008-09-25, 15:49

Join Date: Aug 2008
Posts: 87
ra.ravi.rav
Offline
Regular Contributor
Here is the code in PyS60 for a very tiny player. Here I ask user to enter the path of the file to play through appuifw.query() function.

However I face the problem that the audio output is absent. I changed the play() function as:
Code:
song.stop()
song.play()
but still no output.

I also checked the state and found that its showing the correct state i.e. audio.EOpen before song.play() and audio.EPlaying after song.play() is called.

When I manually enter the code into the interactive console (with the same input file) it works fine.

Please help.
Reply With Quote

#2 Old Re: Unable to play audio files - 2008-09-25, 16:10

Join Date: Dec 2007
Posts: 409
Location: Tempe, AZ
Send a message via Yahoo to shubhendra Send a message via Skype™ to shubhendra
shubhendra's Avatar
shubhendra
Offline
Forum Nokia Champion
Hi ra.ravi.rav,
Is it the same path problem, which was posted in another thread started by you?


IDEAS is all they need but still they think only Genius can give them that.
Reply With Quote

#3 Old Re: Unable to play audio files - 2008-09-25, 16:22

Join Date: Aug 2008
Posts: 87
ra.ravi.rav
Offline
Regular Contributor
Well the code id same but the problem is different. So I posted in a new thread.
Reply With Quote

#4 Old Re: Unable to play audio files - 2008-09-25, 17:30

Join Date: May 2007
Posts: 2,738
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Quote:
Originally Posted by ra.ravi.rav View Post
Well the code id same but the problem is different. So I posted in a new thread.
Hi,

May be there are problems with the way you provide the path in the appuifw.query !

Let us know what you provide as input in the query.

Best Regards,
Croozeus
Reply With Quote

#5 Old Re: Unable to play audio files - 2008-09-25, 17:37

Join Date: Aug 2008
Posts: 87
ra.ravi.rav
Offline
Regular Contributor
yeah sure. I provide the path as "E\Sounds\song.mp3"
And when I use the same path in appuifw.query() in the shell and use its return value to play the file it runs.
I do learn from past mistakes.
Reply With Quote

#6 Old Re: Unable to play audio files - 2008-09-26, 17:21

Join Date: Aug 2008
Posts: 87
ra.ravi.rav
Offline
Regular Contributor
any answers?
Reply With Quote

#7 Old Re: Unable to play audio files - 2008-09-26, 17:22

Join Date: May 2007
Posts: 2,738
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Quote:
Originally Posted by ra.ravi.rav View Post
yeah sure. I provide the path as "E\Sounds\song.mp3"
And when I use the same path in appuifw.query() in the shell and use its return value to play the file it runs.
I do learn from past mistakes.
I thought it was solved.

Doesn't providing "E\Sounds\song.mp3" in the path work fine ?

Best Regards,
Croozeus
Reply With Quote

#8 Old Re: Unable to play audio files - 2008-09-26, 17:32

Join Date: Aug 2008
Posts: 87
ra.ravi.rav
Offline
Regular Contributor
I am extremely sorry I forgot to provide the code of the program.
Here it is: http://pastebin.com/m244b4b4d

The problem is not solved, I just provided more info about it. The audio output is absent as I said.

But when I run the following commands on the shell it just works fine, with the same input of course.
Code:
s = appuifw.query(u"Path", "text")
song = audio.Sound.open(s)
song.play()
Reply With Quote

#9 Old Re: Unable to play audio files - 2008-09-27, 08:37

Join Date: Jul 2008
Posts: 103
ck.umraliya's Avatar
ck.umraliya
Offline
Forum Nokia Champion
hi ra.ravi.rav
I modified your code to below and now its working(on N70)
Try it...
Code:
import appuifw
import e32
from audio import*
import sys

global song
def play():
    global song
    s = appuifw.query(u"Path",'text',u"e:\Sounds\Digital\Aafreen.mp3")
    song = Sound.open(s)
    song.play()
    
def pause():
    global song
    song.stop()

def stop():
    global song
    Sound.close(song)

def exit():
    exit = appuifw.query(u"You want to exit?", "query")
    if exit:
        sys.exit(0)
    else:
        pass

if __name__ == '__main__':
    appuifw.app.menu = [(u"Play", play), (u"Pause", pause), (u"Stop", stop)]
    appuifw.app.exit_key_handler = exit
    appuifw.app.title = u"FooMP3"
    app_lock = e32.Ao_lock()
    app_lock.wait()
Regards,
Chintan Umraliya
Reply With Quote

#10 Old Question Re: Unable to play audio files - 2008-09-27, 08:56

Join Date: Aug 2008
Posts: 87
ra.ravi.rav
Offline
Regular Contributor
Thanks a lot ck.umraliya

Thats really wonderful.
There is just a small itch, why the earlier code didn't work?
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
Unable To Stream SMIL files On Nokia 6681 ali.sajjad Streaming and Video 3 2009-10-13 08:21
Unable to play audio to telephony uplink on S60 3rd Edition, FP1 devices inmaat General Symbian C++ 21 2009-06-17 19:44
To play raw audio data file pawans Symbian Tools & SDKs 2 2008-12-11 12:38
Unable to play MP3 audio clip from descriptor anand_zain76 Symbian Media (Graphics & Sounds) 4 2008-03-10 11:42

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