mixer.c
changeset 382 50501e45c57b
parent 373 6271eafc6e70
child 383 0d05ac848d6a
equal deleted inserted replaced
381:2064088ea781 382:50501e45c57b
    32 
    32 
    33 #include "SDL_mixer.h"
    33 #include "SDL_mixer.h"
    34 #include "load_aiff.h"
    34 #include "load_aiff.h"
    35 #include "load_voc.h"
    35 #include "load_voc.h"
    36 #include "load_ogg.h"
    36 #include "load_ogg.h"
       
    37 #include "load_flac.h"
    37 
    38 
    38 #define __MIX_INTERNAL_EFFECT__
    39 #define __MIX_INTERNAL_EFFECT__
    39 #include "effects_internal.h"
    40 #include "effects_internal.h"
    40 
    41 
    41 /* Magic numbers for various audio file formats */
    42 /* Magic numbers for various audio file formats */
    42 #define RIFF		0x46464952		/* "RIFF" */
    43 #define RIFF		0x46464952		/* "RIFF" */
    43 #define WAVE		0x45564157		/* "WAVE" */
    44 #define WAVE		0x45564157		/* "WAVE" */
    44 #define FORM		0x4d524f46		/* "FORM" */
    45 #define FORM		0x4d524f46		/* "FORM" */
    45 #define OGGS		0x5367674f		/* "OggS" */
    46 #define OGGS		0x5367674f		/* "OggS" */
    46 #define CREA	    	0x61657243		/* "Crea" */
    47 #define CREA		0x61657243		/* "Crea" */
       
    48 #define FLAC		0x43614C66		/* "fLaC" */
    47 
    49 
    48 static int audio_opened = 0;
    50 static int audio_opened = 0;
    49 static SDL_AudioSpec mixer;
    51 static SDL_AudioSpec mixer;
    50 
    52 
    51 typedef struct _Mix_effectinfo
    53 typedef struct _Mix_effectinfo
   453 		case OGGS:
   455 		case OGGS:
   454 			loaded = Mix_LoadOGG_RW(src, freesrc, &wavespec,
   456 			loaded = Mix_LoadOGG_RW(src, freesrc, &wavespec,
   455 					(Uint8 **)&chunk->abuf, &chunk->alen);
   457 					(Uint8 **)&chunk->abuf, &chunk->alen);
   456 			break;
   458 			break;
   457 #endif
   459 #endif
       
   460 #ifdef FLAC_MUSIC
       
   461 		case FLAC:
       
   462 			loaded = Mix_LoadFLAC_RW(src, freesrc, &wavespec,
       
   463 					(Uint8 **)&chunk->abuf, &chunk->alen);
       
   464 			break;
       
   465 #endif
   458 		case CREA:
   466 		case CREA:
   459 			loaded = Mix_LoadVOC_RW(src, freesrc, &wavespec,
   467 			loaded = Mix_LoadVOC_RW(src, freesrc, &wavespec,
   460 					(Uint8 **)&chunk->abuf, &chunk->alen);
   468 					(Uint8 **)&chunk->abuf, &chunk->alen);
   461 			break;
   469 			break;
   462 		default:
   470 		default: