medfall

A super great game engine
Log | Files | Refs

mixer.h (681B)


      1 #pragma once
      2 
      3 #define MAX_CONCURRENT_SOUNDS 1024
      4 
      5 #include "intrinsics.h"
      6 #include "memory_arena.h"
      7 #include "assets.h"
      8 
      9 #include "platform_audio_output.h"
     10 
     11 typedef u32 PlayingSoundID;
     12 #define INVALID_SOUND_ID U32_MAX
     13 
     14 enum MixerLoopBool {
     15 	MIXER_DONTLOOP,
     16 	MIXER_LOOP,
     17 };
     18 
     19 void mixer_init();
     20 
     21 void mixer_mix( AudioBuffer * buffer, MemoryArena * arena, u32 samples_to_mix, u32 mix_ahead );
     22 
     23 PlayingSoundID mixer_play( SoundData sound, MixerLoopBool loop = MIXER_DONTLOOP, s32 start_pos = 0 );
     24 PlayingSoundID mixer_play( SoundData sound, s32 start_pos );
     25 void mixer_volume( PlayingSoundID sound_id, float volume );
     26 void mixer_stop( PlayingSoundID sound_id );
     27 void mixer_stop_all();