Questions tagged [sdl-mixer]

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.

117 questions
2
votes
1 answer

SDL_Mixer Audio not playing

Alright so here's the issue. I'm starting to learn SDL, and want to add some audio to this "game" I am making for a school project. The audio won't play from my program, but the code for a tutorial I read and downloaded has audio in it and plays.…
Jarrod A.
  • 93
  • 1
  • 9
2
votes
1 answer

./configure unable to find header files

I'm compiling a project that uses SDL_mixer to play .ogg files. However, Mix_Init(MIX_INIT_OGG) fails, and Mix_GetError() returns "Mixer not built with Ogg Vorbis support". The version of SDL_mixer I'm using is 1.2.12, downloaded via Homebrew. So I…
Emil Laine
  • 41,598
  • 9
  • 101
  • 157
2
votes
0 answers

Mix_LoadWAV returns NULL when it shouldn't

I'm making a game in C++, but I've been running into an issue I just can't figure out when it comes to the sound. I'm using SDL_Mixer, with Mix_Music for the music and Mix_Chunk for the sound effects, but for some reason when I try to load a sound…
CuteCat
  • 21
  • 3
2
votes
1 answer

Error loading .wav file C++

I tried to load a .wav file(afschieten.wav), but I cant load it. I followed the tutorial of lazyfoo: http://lazyfoo.net/SDL_tutorials/lesson11/ The code: I got this on top of file: #include #include "GL/glut.h" #include…
M.Tlan
  • 33
  • 7
2
votes
1 answer

SDL. Current music position

I load my music track using SDL_mixer function: Mix_Music * SDLCALL Mix_LoadMUS(const char *file); For synchronization with video I need to know current music position. How can I determine this?
e40pud
  • 336
  • 2
  • 18
2
votes
2 answers

SDL2_mixer linking undefined references C::B

I am trying to use SDL2_mixer for sound but I get these errors undefined reference to `Mix_OpenAudio' undefined reference to `Mix_LoadWAV_RW' undefined reference to `Mix_PlayChannelTimed' According to Lazy Foo's tutorials undefined references mean…
0ctoDragon
  • 541
  • 1
  • 7
  • 20
2
votes
1 answer

Reading midi-files

I'm trying to help out a friend creating a program. And we need to read some midi-file data. I've searched for a good 2 hours now and I can't really seem to find any straight forward ways of doing it. I've downloaded and hopefully installed…
Aleksander Fimreite
  • 1,439
  • 2
  • 18
  • 31
2
votes
1 answer

No Sound with SDL_mixer

I read and tried all the other posts to that topic, but nothing helped. When I try to play music with Mix_PlayChannel() I don't get an error nor do I hear some sound! I tried for hours now and nothing helps. The program just finishes happily. But no…
beseder
  • 1,352
  • 2
  • 15
  • 25
2
votes
1 answer

SDL_Mixer set sound position

I was wondering if there is a functionality in the SDL_Mixer lib to skip to a certain position in a wav file. I've found out the there is a function called Mix_SetMusicPosition but it won't work with .wav files and it won't let you choose a channel.…
Leon_020
  • 21
  • 3
1
vote
1 answer

Error : "SDL could not initialize! SDL_Error: dsp: No such audio device"

I'm currently working on a personnal project and I have an issue with SDL_mixer or Audio I can compile without any problems but when I try to execute the program I got this error: "SDL could not initialize! SDL_Error: dsp: No such audio device" I'm…
Jarche
  • 31
  • 4
1
vote
0 answers

SDL_RWread and SDL2 Mixer Loading entire file into memory

I am reading WAVE files into memory and then playing them whenever needed I wrote this implementation for loading the file into memory: SDL_RWops* RawData = SDL_RWFromFile("Demo.wav", "rb"); if (!RawData) { Error::Set("Could not…
1
vote
1 answer

What is the Device parameter in Mix_OpenAudioDevice ( SDL2 )

While I know how to use MIX_OpenAudio.... I wanted to know the use of MIX_OpenAudioDevice function It takes several arguments... Device name is one of them So, I want to know that how can we know what the device name is It says we can use a function…
1
vote
1 answer

Why is my SDL_mixer playing my wav. file too fast?

From this Lazy Foo tutorial (https://lazyfoo.net/tutorials/SDL/21_sound_effects_and_music/index.php) I wrote the following lines of code: #include #include bool running = true; int main(int argc, char** argv) { …
1
vote
1 answer

Splitting music file into chunks

How would you go about splitting a music file (preferably mp3) into chunks? I am using the SDL_mixer API. There may be some useful functions in there but I couldn't find any. The purpose is to use FFT on each chunk to get the frequencies to use in…
user816318
  • 55
  • 1
  • 9
1
vote
1 answer

What is difference between Mix_Init and Mix_OpenAudio SDL?

I saw many tutorial of SDL_mixer but none of them are used Mix_Init function. I saw this Mix_Init function on the documentation page https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html The tutorials are only used the function called…
NinjaGameDev
  • 73
  • 2
  • 7