-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaudio.h
More file actions
32 lines (25 loc) · 691 Bytes
/
Copy pathaudio.h
File metadata and controls
32 lines (25 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef AUDIO_H
#define AUDIO_H
#include <stdbool.h>
typedef enum {
SINE,
SAW,
SQUARE,
NOISE,
REST
} WAVEFORM;
// Channel indices
#define CHANNEL_MUSIC 0
#define CHANNEL_SFX 1
#define NUM_CHANNELS 2
// Audio initialization and processing
void tb_audio_init();
void process_audio();
// ABC notation loading
// channel_num: CHANNEL_MUSIC or CHANNEL_SFX, abc_string: ABC notation, waveform: synth type, repeat: loop playback
int audio_load_abc(int channel_num, const char *abc_string, WAVEFORM waveform, bool repeat);
// Channel control
void audio_stop_channel(int channel_num);
void audio_stop_all();
bool is_channel_active(int channel_num);
#endif