-
Notifications
You must be signed in to change notification settings - Fork 0
/
wave.h
49 lines (39 loc) · 1.13 KB
/
wave.h
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
/**
* WAV file handler for PSP
* Original Author: ?
*/
#ifndef __WAVE_H__
#define __WAVE_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
unsigned long channels;
unsigned long samplerate;
unsigned long samplecount;
unsigned long datalength;
unsigned long rateratio; // samplerate / 44100 * 0x10000
unsigned long playptr;
unsigned long playptr_frac;
int playloop;
char *wavdata;
float volume;
float pan;
} wavout_wavinfo_t;
int wavInit();
int wavPlay(wavout_wavinfo_t *wi); // returns slot number
int wavPlay_VolPanPitch(wavout_wavinfo_t *wi, float volume, float pan, float pitch);
wavout_wavinfo_t *wavLoad(char *filename);
void wavoutStopPlay();
void adjustPitch(int slot, float pitch); // 1.0 = normal pitch
// between 0.0 and 1.0 = lowered pitch
// >1.0 higher pitch
void adjustVolume(int slot, float volume); // 1.0 is normal volume, 0.0 silence
void adjustPan(int slot, float pan); // -6dB Panning Law
// 0.5 = center
// 0.0 = max left
// 1.0 = max right
#ifdef __cplusplus
}
#endif
#endif