Open
Description
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:
- Initialize pygame
- Use
pygame.mixer.set_soundfont
to specify a soundfont filepath - Load a midi file with
pygame.mixer.music.load
- Play the midi with
pygame.mixer.music.play
- 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()