| Reply | « Previous Thread | Next Thread » |
|
I have the follwing code, which is a simple mp3 player, I am running it on Nokia 7610 (S60 2ndEd FP1):
Code:
import appuifw, e32, audio, sys
song = None
curr_pos = 0
def play():
s = appuifw.query(u"Path", "text")
print s
song = open(s)
song.play()
def pause():
curr_pos = song.current_position()
song.stop
def stop():
song.stop()
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()
Code:
Traceback (most recent call last):
File "E:\System\Apps\Python\my\mp3player.py", line 9, in play
song = audio.Sound.open(s)
File "E:\system\libs\audio.py", line 44, in open
raise SymbianError,(callback_error[0],
SymbianError: [Errno -28] Error opening file: KErrBadName
Code:
str = appuifw.query(u"Enter file path", "text", "E:\\Sounds\\song.mp3") f = open(str) print dir(f) |
| ra.ravi.rav |
| View Public Profile |
| Find all posts by ra.ravi.rav |
|
I got the solution:
enetring "E:\\Sounds\\song.mp3" translates as "E:\\\\Sounds\\\\song.mp3" by appuifw.query() function. |
| ra.ravi.rav |
| View Public Profile |
| Find all posts by ra.ravi.rav |
|
hi ra.ravi.rav
Instead of entering the full path each time, ![]() you can find out all mp3 files on the phone. Go through this article. Regards, Chintan |
|
Thanks for your reply. Adding autosearch was indeed the next job on the list.
|
| ra.ravi.rav |
| View Public Profile |
| Find all posts by ra.ravi.rav |
|
Quote:
Best Regards, Croozeus |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| [moved] Theme Studio Error | TalJ | Themes/Carbide.ui | 2 | 2009-09-06 04:39 |
| open Flash file | viswa08 | Flash Lite on Nokia Devices | 7 | 2008-09-06 12:29 |
| Unable to create file | Ajmal | Symbian Media (Graphics & Sounds) | 4 | 2008-06-05 05:39 |
| Problem opening file from a dynamic path | didienGanteng | General Symbian C++ | 12 | 2007-06-27 12:13 |
| Unable to open a newly created text file? | yuva69 | General Symbian C++ | 1 | 2002-06-06 15:09 |