SDL_mixer is a sample multi-channel audio mixer library. It supports any number of simultaneously playing channels of 16 bit stereo audio, plus a single channel of music, mixed by the popular FLAC, MikMod MOD, Timidity MIDI, Ogg Vorbis, and SMPEG MP3 libraries.
Questions tagged [sdl-mixer]
117 questions
3
votes
0 answers
Realtime Band-Limited Impulse Train Synthesis using SDL mixer
I'm trying to implement a audio synthesizer using this technique:
https://ccrma.stanford.edu/~stilti/papers/blit.pdf
I'm doing it in standard C, using SDL2_Mixer library.
This is my BLIT function implementation:
double blit(double angle, double M,…

ProGM
- 6,949
- 4
- 33
- 52
3
votes
1 answer
No sound when using SDL_mixer
For some really wierd reason, absolutely no sound plays with SDL_mixer. I've tried everything: Reinstalling the library, checking if the music is actually playable, using Mix_FadeInMusic and Mix_FadeOutMusic, to ABSOLUTELY NO AVAIL. It's telling me…

monster860
- 124
- 9
3
votes
0 answers
How do I use Fluidsynth for MIDI playback in SDL_Mixer?
I've been trying to solve this problem by using FluidSynth with SDL_Mixer.
I am using the latest versions, SDL_Mixer 1.2.12 (DLL from official website) and FluidSynth 1.1.6 (DLL from here) on Windows, which should work with each other.
I've renamed…

SupSuper
- 133
- 2
- 7
3
votes
2 answers
SDL-Mixer audio stops upon starting Reactive-Banana input loop
I've been working on a game that uses multiple audio tracks whose volumes are adjusted in realtime based on mouse motion. I'm using SDl-Mixer for audio, and Reactive-Banana for the game in general. The problem is that the tracks, which have all been…

user1675049
- 33
- 3
2
votes
2 answers
How to change Mix_Chunk to Mix_Music in SDL2
if (SDL_Init(SDL_INIT_AUDIO) < 0) return -1;
if( Mix_OpenAudio( 48000, MIX_DEFAULT_FORMAT, 2, 4096 ) == -1 ) return -1;
Mix_Chunk *wave = Mix_LoadWAV("a.wav");
auto *p = SDL_RWFromMem(wave->abuf, wave->alen);
if(!p || !wave) return…

Zeta
- 913
- 10
- 24
2
votes
0 answers
SDL with C - Blocks remains after being played
I have been working on a game that is a Stacker. Everything works fine, but after you have played and started over the blocks from the previous game still remain there.
Could anyone help me with this problem?
#include
#include…

coralo1665
- 21
- 1
2
votes
0 answers
How to set audio position in Sdl_mixer
I am using SDL_mixer library to play multiple audio together.
I am able to play music together and it working fine, but i want to add a delay in playing audio.For example play first audio from 3 to 10 seconds and second audio from 5 to 14 seconds…

Ariful Jannat Arif
- 159
- 2
- 12
2
votes
0 answers
How can I set a sleep between loop using sdl-mixer?
I'm trying to play music using SDL2_Mixer library in Ubuntu 18.04.
I succeed to play .wav file loop forever as below code.
#define ERROR_BEEP "../audio/beep.wav"
#include
#include
void main()
{
…

djowlrid
- 71
- 1
- 5
2
votes
1 answer
No sound when using SDL_Mixer in C++/Linux
I'm trying to use SDL_mixer in C++ under Linux to play sounds asynchronously, but it somehow doesn't work. When I execute it, no sound is playing at all. I'm not quite familiar with SDL and classes though, so it would be very helpful if someone…

Totemi1324
- 468
- 1
- 6
- 19
2
votes
2 answers
SDL_mixer poor quality with WAVE audio format
I want to write a simple console music player, which supports both .mp3 and .wav audio formats.
Playing .wav files with SDL_mixer lowers the quality of the sound, but with mp3 files it does not. When the .wav file starts playing there is a…

Anton Büttner
- 91
- 1
- 7
2
votes
1 answer
SDL Mix_LoadMUS not loading .mp3
So Apparently i've been trying to load an .mp3 using SDL_mixer. However, this does not work, as opposed to the libsdl wiki: SDL_mixer Mix_LoadMUS
I was hoping for it to work, but when loading and playing the file, the following errors popped in my…

Barkypoo
- 25
- 1
- 4
2
votes
0 answers
Issue reusing a Mix_Music more than once
Consider the following case.
I have two mp3 files that I load with Mix_LoadMUS, therefore obtaining two instances of Mix_Music *. Let's call them m1 and m2.
I play the first track for a while using Mix_PlayMusic:
Mix_PlayMusic(m1, -1);
Then I (let…

skypjack
- 49,335
- 19
- 95
- 187
2
votes
0 answers
Loading sound with SDL2.0 causes exception in MS Visual Studio
I have the following sound loading function:
bool Sound::load(const char* fileName)
{
sound = Mix_LoadWAV(fileName);
if (sound == nullptr)
{
std::cout << "Failed to load sound at path: " << fileName << "SDL_mixer error: " <<…

MivVG
- 679
- 4
- 16
2
votes
3 answers
Why would SDL_Mixer not play music for certain mp3s?
Why would SDL_Mixer not play music for certain mp3s?
I am utilizing SDL_Mixer for music playback in an application I am creating. On certain songs (entire albums actually), the music will simply not play without returning any errors. The music data…

jamesmillerio
- 3,154
- 4
- 27
- 32
2
votes
1 answer
Can I use SDL_mixer without SDL?
I have a game that uses GLFW for window creation and input. Is it possible to use SDL_mixer for audio without SDL?

Tudor Lechintan
- 61
- 2
- 7