Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pygame.mixer.Sound() throws "Unrecognized audio format" for some Vorbis file (with emoji in metadata?) #3350

Open
TransparentLC opened this issue Feb 25, 2025 · 3 comments
Labels
bug Not working as intended

Comments

@TransparentLC
Copy link

TransparentLC commented Feb 25, 2025

Environment:

Platform:               Windows-11-10.0.26100-SP0
System:                 Windows
System Version:         10.0.26100
Processor:              Intel64 Family 6 Model 158 Stepping 10, GenuineIntel    SSE2: Yes       AVX2: Yes       NEON: No
Architecture:           Bits: 64bit     Linkage: WindowsPE

Python:                 CPython 3.12.9 (tags/v3.12.9:fdb8142, Feb  4 2025, 15:27:58) [MSC v.1942 64 bit (AMD64)]
pygame version:         2.5.3
SDL versions:           Linked: 2.30.12 Compiled: 2.30.12
SDL Mixer versions:     Linked: 2.8.0   Compiled: 2.8.0
SDL Font versions:      Linked: 2.24.0  Compiled: 2.24.0
SDL Image versions:     Linked: 2.9.0   Compiled: 2.9.0
Freetype versions:      Linked: 2.11.1  Compiled: 2.11.1

Display Driver:         windows
Mixer Driver:           wasapi

Current behavior:

As the title said, some Vorbis audio files in my game don't load.

I have tested on both Windows and Linux. It works fine on Linux, but not on Windows.

Expected behavior:

The audio files are loaded properly.

Screenshots

No screenshots.

Steps to reproduce:

I uploaded a zip file that contains some Vorbis files. Some of them work and others throw an error. These files play properly with other audio players.

sfx.zip

  • hyper-activate.ogg Error
  • hyper-end.ogg Error
  • charge.ogg
  • get-point.ogg

Maybe the emoji in the metadata is preventing pygame-ce from loading?

MediaInfo
General
Complete name                            : hyper-activate.ogg
Format                                   : Ogg
File size                                : 45.2 KiB
Duration                                 : 2 s 530 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 146 kb/s

Audio
ID                                       : 41561166 (0x27A2C4E)
Format                                   : Vorbis
Format settings, Floor                   : 1
Duration                                 : 2 s 530 ms
Bit rate mode                            : Variable
Bit rate                                 : 192 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 kHz
Compression mode                         : Lossy
Stream size                              : 59.3 KiB
Writing library                          : libVorbis (⛄⛄⛄⛄) (20150105 (⛄⛄⛄⛄))
General
Complete name                            : hyper-end.ogg
Format                                   : Ogg
File size                                : 13.8 KiB
Duration                                 : 730 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 155 kb/s

Audio
ID                                       : 41645201 (0x27B7491)
Format                                   : Vorbis
Format settings, Floor                   : 1
Duration                                 : 730 ms
Bit rate mode                            : Variable
Bit rate                                 : 192 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 kHz
Compression mode                         : Lossy
Stream size                              : 17.1 KiB
Writing library                          : libVorbis (⛄⛄⛄⛄) (20150105 (⛄⛄⛄⛄))
General
Complete name                            : charge.ogg
Format                                   : Ogg
File size                                : 76.9 KiB
Duration                                 : 2 s 33 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 310 kb/s
Writing application                      : Lavc59.33.100 libvorbis

Audio
ID                                       : 2365303778 (0x8CFBABE2)
Format                                   : Vorbis
Format settings, Floor                   : 1
Duration                                 : 2 s 33 ms
Bit rate mode                            : Variable
Bit rate                                 : 192 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 kHz
Compression mode                         : Lossy
Stream size                              : 47.6 KiB (62%) / 47.6 KiB (62%)
Writing library                          : Lavf59.25.100
General
Complete name                            : charge.ogg
Format                                   : Ogg
File size                                : 76.9 KiB
Duration                                 : 2 s 33 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 310 kb/s
Writing application                      : Lavc59.33.100 libvorbis

Audio
ID                                       : 2365303778 (0x8CFBABE2)
Format                                   : Vorbis
Format settings, Floor                   : 1
Duration                                 : 2 s 33 ms
Bit rate mode                            : Variable
Bit rate                                 : 192 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 kHz
Compression mode                         : Lossy
Stream size                              : 47.6 KiB (62%) / 47.6 KiB (62%)
Writing library                          : Lavf59.25.100

Test code

import pygame
pygame.init()
pygame.mixer.Sound('/path/to/these/audio/files.ogg')

Stack trace/error output/other error logs

paste other relevant logs or stack traces here, if applicable
@TransparentLC TransparentLC added the bug Not working as intended label Feb 25, 2025
@TransparentLC TransparentLC changed the title pygame.mixer.Sound() throws "Unrecognized audio format" for some Vorbis file (with emoji in metadata?) pygame.mixer.Sound() throws "Unrecognized audio format" for some Vorbis file (with emoji in metadata?) Feb 25, 2025
@ankith26
Copy link
Member

Hello, thanks for the bug report!

I just tested it on my Ubuntu 24.10 system, and I cannot reproduce the issue locally (on pygame-ce 2.5.3 (SDL 2.30.12, Python 3.12.7)). This issue could either be windows specific, or something specific to your setup

@damusss
Copy link
Member

damusss commented Feb 25, 2025

@ankith26 I'm on windows, and this is the result:

pygame-ce 2.5.2 (SDL 2.30.8, Python 3.12.5)
loaded charge correctly
loaded get-point correctly
could not load hyper-activate, Unrecognized audio format
could not load hyper-end, Unrecognized audio format

So it must be a windows specific issue

@TransparentLC
Copy link
Author

The audio files can be loaded in pygame-ce 2.4.0, but not in 2.4.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
Projects
None yet
Development

No branches or pull requests

3 participants