Open lorenzoantei opened 1 year ago
I'm try to edit led-image-viewer util to add mp3 playback. I add `#include <SDL2/SDL.h>
into main(): `if (SDL_Init(SDL_INIT_AUDIO) != 0) { printf("Error initializing SDL: %s\n", SDL_GetError()); return -1; }
int mixer_flags = MIX_INIT_MP3; int mixer_result = Mix_Init(mixer_flags); if (mixer_flags != mixer_result) { printf("Error initialising SDL mixer (result: %d).\n", mixer_result); printf("Mix_Init: %s\n", Mix_GetError()); return -1; }
Mix_OpenAudio(44100, AUDIO_S16SYS, 2, 640); Mix_Music *music = Mix_LoadMUS("sample.mp3"); Mix_PlayMusic(music, 1); uint32_t audio_start_time = SDL_GetTicks();`
But I'm getting trouble with make. Can someone suggest how I can do it? I simply need to play a mp3 looped with 3 gifs.
this is more of a general "how to use SDL" question, have you tried stackexchange? nothing specific to rpi-rgb-led-matrix...
I'm try to edit led-image-viewer util to add mp3 playback. I add `#include <SDL2/SDL.h>
include <SDL2/SDL_mixer.h>`
into main(): `if (SDL_Init(SDL_INIT_AUDIO) != 0) { printf("Error initializing SDL: %s\n", SDL_GetError()); return -1; }
int mixer_flags = MIX_INIT_MP3; int mixer_result = Mix_Init(mixer_flags); if (mixer_flags != mixer_result) { printf("Error initialising SDL mixer (result: %d).\n", mixer_result); printf("Mix_Init: %s\n", Mix_GetError()); return -1; }
Mix_OpenAudio(44100, AUDIO_S16SYS, 2, 640); Mix_Music *music = Mix_LoadMUS("sample.mp3"); Mix_PlayMusic(music, 1); uint32_t audio_start_time = SDL_GetTicks();`
But I'm getting trouble with make. Can someone suggest how I can do it? I simply need to play a mp3 looped with 3 gifs.