campy.util.sound module

File: sound.py

This file defines a class that represents a sound.

class campy.util.sound.Sound(filename)[source]

Bases: object

This class encapsulates a sound file. The sound file is specified in the constructor and must be a file in either the current directory or a subdirectory named sounds.

The following code, for example, plays the sound file ringtone.wav:

ringtone = Sound("ringtone.wav")
ringtone.play()
play()[source]

Starts playing the sound.

This call returns immediately without waiting for the sound to finish.