Python Forum
[PyGame] mixer failing in 2.0
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] mixer failing in 2.0
#1
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.
=====================
Reply
#2
libvorbisfile-3.dll is the driver for the .ogg file format.

Try a .wav and see if that works.
Reply
#3
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.
michael1789 likes this post
Reply
#4
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
Reply
#5
(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?
Reply
#6
(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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  pygame.mixer.init() devicename issue wanhr 2 4,780 Sep-15-2019, 09:08 AM
Last Post: wanhr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020