![]() |
Playing sounds in python?
What is the easiest way to play sounds in python? I made a game for a class at school and every time a point is scored, a sound should be played.
I've looked on google and I've found these huge library packages that should let me do it, but I've had no success in getting them to work. Can anyone help me? Thanks :D :banana: |
Nevermind, I got it work! I suppose reading the examples on the Pygame website helps a lot :o
|
Make sure you're using the functions that let you play all formats of music. Don't make the same mistake I made and use the class for 'wav' formats only!
|
Quote:
|
:
import pygameI'm not exactly sure about the mp3 one, because that's what my memory leaves me after 6 months. If it's not that, it'll be something very similar. The advantages with the 'wav' method is you can preload sound objects and play when required. You can also play upon multiple tracks. mixer.music's only advantage is compatibility with all standard files (midi/mp3...) but you can't create objects or pre-load and/or play multiple sound files. |
Google PyMedia.
|
using api is better and faster
|
Quote:
|
MCISendString API from the wimm.dll
|
Quote:
|
| All times are GMT -5. The time now is 5:10 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC