Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Playing Sound

DZone's Guide to

Playing Sound

·
Free Resource
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.

from audio import *
f = 'C:\\Nokia\\Sounds\\Digital\\28050.amr'
s = Sound.open(f)
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

s.play(3) # 3 times
s.play(KMdaRepeatForever) # or just use -2
s.stop() # Ok, enough of it
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}