Quickstart

Let’s play a sample sound. Try the following simple script:

 1import pyfmodex
 2
 3system = pyfmodex.System()
 4system.init()
 5sound = system.create_sound("somefile.mp3")
 6channel = sound.play()
 7
 8while channel.is_playing:
 9   pass
10
11sound.release()
12system.release()

Of course, somefile.mp3 must be replaced with something that actually exists. :-)

Note that the while loop is necessary (at least in this simple example) to keep the main thread alive long enough. You should know this if you want to use FMOD however. If you don’t, it’s probably a good thing to spend some time with the FMOD API documentation first.