Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Korakot Chaovavanich http://korakot.stumbleupon.com

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Playing sound

py_s60 1.1.3 provides audio module which allow you to
play sound. This should let people write some fun games.

Here's a quick example.
   1  
   2  from audio import *
   3  f = 'C:\\Nokia\\Sounds\\Digital\\28050.amr'
   4  s = Sound.open(f)
   5  s.play()

I have tried calling Sound.open(f).play() directly, but
it doesn't seem to work. I may be waiting for file loading
or wait for some callback. I don't know.

You can play it many times or repeat forever
   1  
   2  s.play(3) # 3 times
   3  s.play(KMdaRepeatForever) # or just use -2
   4  s.stop() # Ok, enough of it
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS