1
1
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

37 lines
796 B

#ifndef AUDIO_H
#define AUDIO_H
#include <SDL2/SDL_audio.h>
#include "types.h"
#include <math.h>
#include <stdlib.h>
#define G_AUDIO_SFREQ 8000
#define G_AUDIO_BSIZE 512
struct game_sounds {
unsigned int t;
Mix_Chunk *collision;
Mix_Chunk *rope_attach;
Mix_Chunk *rope_pull;
Mix_Chunk *background;
/* Looping samples (need backbuffer to fill while playing ) */
Mix_Chunk *menu;
};
extern struct game_sounds game_sounds;
void play_game_sound(Mix_Chunk *chunk, int len, int channel);
void start_audio(void);
Uint8 pitchshift_hit(unsigned int t, void *arg);
void synthplay_now(Uint8 (*bbgen)(unsigned int t, void *), void *arg, int len);
enum audio_channel_names {
BC_COLLISION = 1,
BC_ROPE_PULL = 2,
BC_ROPE_ATTACH = 3,
BC_MUSIC = 4,
};
#endif