Skip to content

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

Open
@TransparentLC

Description

@TransparentLC

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugNot working as intended

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions