| Summary: | All sound is permanently disabled after receiving phone call. | ||
|---|---|---|---|
| Product: | SDL_mixer | Reporter: | Diego <diegoacevedo91> |
| Component: | misc | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | amaranth72 |
| Version: | 2.0.0 | ||
| Hardware: | iPhone/iPod touch | ||
| OS: | iOS (All) | ||
A Mix_CloseAudio and Mix_OpenAudio does allow the sound to restart. This should be fixed as of https://hg.libsdl.org/SDL/rev/e9c3e64fdc84 Works great! Thanks! |
When music or channels are playing sound and a phone call is received, all sound is then permanently disabled. An app restart is required to restart the sound (or maybe just a Mix_CloseAudio and Mix_OpenAudio, this was untested). The error is reproduced when a phone call is received while running the following code on an iPhone 4S running iOS 7.1.1 and an iPhone 5C running 7.0.4. ////CODE #include "SDL.h" #include "SDL_mixer.h" #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 480 int main(int argc, char *argv[]) { SDL_Window *window; SDL_Renderer *renderer; int done; SDL_Event event; if (SDL_Init(SDL_INIT_VIDEO) < 0) { printf("Could not initialize SDL\n"); return 1; } if (Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 4096) < 0) printf("Unable to init audio: %s\n", Mix_GetError()); Mix_Music *music = Mix_LoadMUS("music.wav"); window = SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_OPENGL); renderer = SDL_CreateRenderer(window, -1, 0); done = 0; while (!done) { while (SDL_PollEvent(&event)) { if (event.type == SDL_QUIT) { done = 1; } } SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); SDL_RenderClear(renderer); SDL_RenderPresent(renderer); Mix_PlayMusic(music,0); SDL_Delay(3000); } SDL_Quit(); return 0; }