Skip to content

Instantly share code, notes, and snippets.

@3IMAD69
3IMAD69 / gist:6a5617d82511212774b091b95e532c54
Created December 21, 2023 13:20 — forked from cdave1/gist:10563386
Play an mp3 with SDL2
#include "SDL2/SDL.h"
#include "SDL2/SDL_mixer.h"
static const char *MY_COOL_MP3 = "cool_tunes.mp3";
int main(int argc, char **argv) {
int result = 0;
int flags = MIX_INIT_MP3;
if (SDL_Init(SDL_INIT_AUDIO) < 0) {