Everyone knows about WAVs and MP3’s/OGG’s. In comparison, take a song that’s relatively 3 minutes long in mp3 (or ogg) format, it’s about 3mb. But in wav format it is 37mb. Now you would understand that no game designer wants to distribute their games for download while the games file size is over 100mb from sounds alone, right? WAV format is the only sound file that Blender (2.49b) understands at the time being. Hopefully Blender 2.5 will have mp3 and ogg support (correct me if I’m wrong!) But until then I’ve got a few games ranging from 42mb to 100mb… as .blend files, not the zipped folders with the exe and dll’s.
I have heard of “pygame” and I was probably using an outdated version of it also, it gave me a lot of errors and didn’t work.
I have seen ST150’s pygame sound/music tutorial (http://www.blending-online.co.uk/8501/37901.html) which was obviously outdated or his instructions failed. I tried this and the only result I got was several error messages in the console window. I also looked at “Mmph!”'s tutorial but that also seemed outdated, as I am currently using Python 2.6 with Blender 2.49b (on Windows Vista).
I installed pygame for python 2.6, but I see Blender users packing up these pygame files with mp3 games. I don’t know where to find these specific files for the .exe versions of my games and I don’t know the proper python code to import the pygame to play the mp3 files. I need some help here this is confusing! :eek:
[edit] I used the pygame from ST150’s tutorial (link above), took the python 2.3 file out and used the following code to play the music:
import pygame.mixer
import os
pygame.mixer.init()
pygame.mixer.music.load("music.ogg")
pygame.mixer.music.play()
Once I put the py and pyc files along with the pygame folder into the main folder with the dll’s and exe, I got the game running but received the following error in the console window when I pressed space bar to activate the python code (using logic in blender).
Error in console window:
Python script error from controller “cont#CONTR#1”:
Traceback (most recent call last):
File “music”, line 1, in <module>
File “C:\Users\Ryuzaki\Desktop\0test\pygame_init_.py”, line 64, in <module>
from pygame.base import *
ImportError: DLL load failed: the specified module could not be found.
I’m still not sure what to do here or what files to stick with [end edit]