Skip to content

pygame.mixer does not use user-specified soundfonts on windows #2375

Open
@AlexanderGroeger

Description

@AlexanderGroeger

This issue is a continuation of an unresolved issue with this merged PR.

Environment:

  • Operating system Windows 11
  • Python version 3.11.4
  • SDL version SDL 2.26.5
  • PyGame version 2.4.0.dev1

Current behavior:

Setting a soundfont for the pygame.mixer does not throw any warnings or errors. The specified soundfont is used by the mixer as intended on other operating systems, but on Windows, specifying a custom soundfont is ignore and the default Microsoft GS Wavetable Synth is used instead.

Expected behavior:

The pygame.mixer should use a synthesizer that always incorporates user-specified soundfonts when specified.

Steps to reproduce:

  1. Initialize pygame
  2. Use pygame.mixer.set_soundfont to specify a soundfont filepath
  3. Load a midi file with pygame.mixer.music.load
  4. Play the midi with pygame.mixer.music.play
  5. Listen and notice that audio is not using the instruments in the specified soundfont

Test code

import pygame
pygame.init()

pygame.mixer.set_soundfont("path/to/soundfont.sf2")
print("Loaded soundfont path: ", pygame.mixer.get_soundfont())

pygame.mixer.music.load("path/to/music.mid")
print("Loaded midi file")

pygame.mixer.play()
print("Playing midi with soundfont")

input("Hit enter to close program")
pygame.mixer.stop()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugNot working as intendedmixerpygame.mixer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions