The binary for SDL_Mixer (win32) downloadable from the site apparently does
not have smpeg support built in, and so far, I can’t get the file to
install/run for me (and I even had someone helping me for an hour and a half
last night!). Of course, I’ve never had any luck with running ./configure;
make; make install stuff…
So, does anyone know where I could find a copy of the SDL_mixer dll that
includes smpeg support at? I completely give up trying to run that make
install stuff…
Thanks
-Jim
#include <SDL.h>
#include <SDL_mixer.h>
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
printf(“SDL Ba?lat?l?yor…”);
if (SDL_Init(SDL_INIT_AUDIO)==-1)
{
printf(“BA?ARISIZ >> %s\n”,SDL_GetError());
exit(1);
}
printf(“TAMAM\n”);
printf("Ses Moduna Ge?iliyor...");
if (Mix_OpenAudio(44100,MIX_DEFAULT_FORMAT,2,1024)==-1)
{
printf("BA?ARISIZ >> %s\n",Mix_GetError());
exit(2);
}
printf("TAMAM\n");
printf("Dalga 1 Belle?e Y?kleniyor...");
Mix_Chunk *deneme;
deneme=Mix_LoadWAV("sample.wav");
if (!deneme)
{
printf("BA?ARISIZ >> %s\n",Mix_GetError());
}
printf("TAMAM\n");
printf("Dalga 2 Belle?e Y?kleniyor...");
Mix_Chunk *deneme2;
deneme2=Mix_LoadWAV("sample2.wav");
if (!deneme2)
{
printf("BA?ARISIZ >> %s\n",Mix_GetError());
}
printf("TAMAM\n");
Mix_VolumeChunk(deneme,128);
Mix_VolumeChunk(deneme2,128);
Mix_AllocateChannels(2);
if (Mix_PlayChannel(0,deneme,-1)==-1);
{
printf("Bildiri >> 'deneme' Oynat?lam?yor : %s\n",Mix_GetError());
}
if (Mix_PlayChannel(1,deneme2,-1)==-1);
{
printf("Bildiri >> 'deneme2' Oynat?lam?yor : %s\n",Mix_GetError());
}
//Mix_AudioClose();
//SDL_Quit();
printf("Bildiri >> '%d' Kanal Oynat?l?yor\n",Mix_Playing(-1));
printf("Bildiri >> '%d' Kanal Dondurulmu?\n",Mix_Paused(-1));
//Mix_Pause(Kanal Numaras?) hepsi i?in -1
//Mix_Resume(Kanal Numaras?) hepsi i?in -1
//Mix_HaltChannel(Kanal Numaras?) hepsi i?in -1
}
here is my sdl_mixer application’s source code,i compile this and run,it plays 2 wav files simultanously but don’t play the complete wave file.it stops after few seconds
whyy?
thank you
here is my sdl_mixer application’s source code,i compile this and
run,it plays 2 wav files simultanously but don’t play the complete
wave file.it stops after few seconds whyy? thank you
Because when you hit the end of main, the program ends, stopping the
sound thread and closing the audio device.
You probably need something like at the very end of main():
// Sit here until mixer has finished playing (that happens in another thread).
while (Mix_Playing(-1))
{
SDL_Delay(10);
}
// nothing playing anymore, so let’s quit.
Mix_CloseAudio();
SDL_Quit();
return(0);
–ryan.
i have a problem with Mix_PlayChannel
it plays a half of wav file and stops.
i need help
i’m using sdl_mixer
i playing 48kHz wavs files with it
the sound is ok,
but now i wonder if the mixer is capable of playing 48kHz wavs or
does it play them as if they were 44.1kHz wavs???