| Summary: | Loading a sound file a second time fails | ||
|---|---|---|---|
| Product: | SDL_mixer | Reporter: | macite |
| Component: | misc | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | ||
| Version: | 1.2.11 | ||
| Hardware: | All | ||
| OS: | All | ||
Corrected version of SDL_mixer in bug report. Also wanted to confirm that switching to the previous version of SDL mixer fixes this issue. Can you uninstall SDL_mixer and re-install version 1.2.11 to confirm the problem? This is the exact bug that was fixed by the 1.2.11 release. Thanks! Sorry, my mistake was still using 1.2.10. Have updated an works fine now. Great, thanks for the update! |
In the new version of SDL mixer (at least on Mac and Windows) loading a ogg file (haven;t tested others) twice fails to load the sound effect the second time. The following code only plays the sound effect once, with the *se2 == null and no error reported by SDL: Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 2048 ); //printf("%d\n", Mix_AllocateChannels(32)); Mix_Chunk *se = Mix_LoadWAV("start.ogg"); int ch = Mix_PlayChannel( -1, se, 0); Mix_Volume(ch, 128); while(Mix_Playing(ch) != 0) { SDL_Delay(100); } Mix_FreeChunk(se); Mix_Chunk *se2 = Mix_LoadWAV("start.ogg"); ch = Mix_PlayChannel( -1, se2, 0); Mix_Volume(ch, 128); while(Mix_Playing(ch) != 0) { SDL_Delay(100); }