-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAudio.h
More file actions
51 lines (47 loc) · 1.11 KB
/
Copy pathAudio.h
File metadata and controls
51 lines (47 loc) · 1.11 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <stdint.h>
#include <stdio.h>
#include <stdbool.h>
const char soundNames[100][10] = {
{"menu"},
{"321go"},
{"smash"},
{"sine"},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{}
};
struct AudioParams {
uint16_t soundIndex;
uint32_t startIndex;
int32_t endIndex; // in frames. if endIndex == -1, play entire song
uint32_t frames;
int32_t FIFO_size; // -1 means not set
float volume;
bool loop;
FILE* file;
};
extern void ReadSDFIFO();
extern void Audio_init();
extern void Audio_initSD();
extern void Audio_closeSD();
extern int8_t Audio_playAudio(struct AudioParams sendable);
extern int8_t Audio_play(uint16_t soundIndex, float volume, uint32_t startIndex=0, int32_t endIndex=-1, bool loop=false);
extern void Audio_destroyAudio(int8_t slotID);
extern void Audio_destroyAllAudio();
extern void Audio_DAC_write(uint16_t mapping);
extern void Audio_initParams(struct AudioParams* params);