Python Forum
[PyGame] mixer failing in 2.0 - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Game Development (https://python-forum.io/forum-11.html)
+--- Thread: [PyGame] mixer failing in 2.0 (/thread-32614.html)



mixer failing in 2.0 - fmr300 - Feb-21-2021

Just updated to Pygame 2 and have a problem that perhaps somebody has run into before.
Here's the simple code that's failing, and the shell output further below. I added the print-statement just to prove that the file does exist.

import pygame, os
pygame.init()
pygame.mixer.init()
print ("\n Music file exists? ", os.path.exists('music\\Rawhide.ogg'), "\n" )
pygame.mixer.music.load('music\\Rawhide.ogg')

===================== RESTART: C:/Users/Mark/Dropbox/Python/Scale/test.py =====================
pygame 2.0.1 (SDL 2.0.14, Python 3.9.1)
Hello from the pygame community. https://www.pygame.org/contribute.html

Music file exists? True

Traceback (most recent call last):
File "C:/Users/Mark/Dropbox/Python/Goebberts_scale/test.py", line 9, in <module>
pygame.mixer.music.load('music\\Rawhide.ogg')
pygame.error: Failed loading libvorbisfile-3.dll: The specified module could not be found.
=====================


RE: mixer failing in 2.0 - michael1789 - Feb-21-2021

libvorbisfile-3.dll is the driver for the .ogg file format.

Try a .wav and see if that works.


RE: mixer failing in 2.0 - nilamo - Feb-22-2021

I'd suggest taking this to the Pygame support channels: https://www.pygame.org/wiki/info

The Windows binary of pygame is supposed to include all optional features, which includes Vorbis audio support. If you were on Linux or Mac, you might have to install libvorbis through your package manager, but the Windows installer should absolutely have that covered for you.


RE: mixer failing in 2.0 - BashBedlam - Mar-14-2021

Try this and let us know if it works... Okay?

import pygame
pygame.mixer.init()
screen = pygame.display.set_mode ((400, 300))
pygame.mixer.music.load('music\\Rawhide.ogg')
pygame.mixer.music.play ()
while True :
	for action in pygame.event.get () :
		if action.type == pygame.QUIT :
			pygame.mixer.music.stop ()
			pygame.quit ()
			break



RE: mixer failing in 2.0 - michael1789 - Mar-15-2021

(Mar-14-2021, 11:43 PM)BashBedlam Wrote: Try this and let us know if it works... Okay?

import pygame
pygame.mixer.init()
screen = pygame.display.set_mode ((400, 300))
pygame.mixer.music.load('music\\Rawhide.ogg')
pygame.mixer.music.play ()
while True :
	for action in pygame.event.get () :
		if action.type == pygame.QUIT :
			pygame.mixer.music.stop ()
			pygame.quit ()
			break

How is this expected to load a .ogg file differently that what was originally posted?


RE: mixer failing in 2.0 - BashBedlam - Mar-15-2021

(Mar-15-2021, 03:08 PM)michael1789 Wrote: How is this expected to load a .ogg file differently that what was originally posted?
It doesn't... It just gives it time to play before pygame ends.