void snd_StopStreaming( int streamID ) { assert( ( streamID >= 0 ) && ( streamID < MAX_STREAMING_SOUNDS ) ); SDL_LockAudioDevice( devID ); { streamingSounds[streamID].playing = false; SDL_FreeAudioStream( streamingSounds[streamID].sdlStream ); streamingSounds[streamID].sdlStream = NULL; } SDL_UnlockAudioDevice( devID ); }
void snd_UnloadStream( int streamID ) { assert( ( streamID >= 0 ) && ( streamID < MAX_STREAMING_SOUNDS ) ); SDL_LockAudioDevice( devID ); { streamingSounds[streamID].playing = false; stb_vorbis_close( streamingSounds[streamID].access ); streamingSounds[streamID].access = NULL; SDL_FreeAudioStream( streamingSounds[streamID].sdlStream ); streamingSounds[streamID].sdlStream = NULL; } SDL_UnlockAudioDevice( devID ); }
void snd_StopStreamingAllBut( int streamID ) { SDL_LockAudioDevice( devID ); { for( int i = 0; i < MAX_STREAMING_SOUNDS; ++i ) { if( i == streamID ) continue; if( ( streamingSounds[i].access != NULL ) && streamingSounds[i].playing ) { streamingSounds[i].playing = false; SDL_FreeAudioStream( streamingSounds[streamID].sdlStream ); streamingSounds[streamID].sdlStream = NULL; } } } SDL_UnlockAudioDevice( devID ); }
static void TIMIDITY_Delete(void *context) { TIMIDITY_Music *music = (TIMIDITY_Music *)context; if (music->song) { Timidity_FreeSong(music->song); } if (music->stream) { SDL_FreeAudioStream(music->stream); } if (music->buffer) { SDL_free(music->buffer); } SDL_free(music); }