Skip to content

Instantly share code, notes, and snippets.

@ravioli67
ravioli67 / gist:73127ba6c8af99abaacc9d89f0460e77
Created October 6, 2026 15:54
How to play a .mp3 file in Mojo
from python import Python
fn main() raises:
let pygame = Python.import_module("pygame")
_ = pygame.mixer.init()
# Load file and play
_ = pygame.mixer.music.load("your_audio_file.mp3")
_ = pygame.mixer.music.play()