summaryrefslogtreecommitdiffhomepage
path: root/src/audio.h
diff options
context:
space:
mode:
authorJoshua Reisenauer <[email protected]>2016-04-30 15:41:46 -0700
committerJoshua Reisenauer <[email protected]>2016-04-30 15:41:46 -0700
commita1038f61b60ad21c936af783facc91fe01607be3 (patch)
tree0e375790f9b5bd278554c85b9fb94f2c92c6ae76 /src/audio.h
parent5f1e8b827822ded6d24d71f75e1f1d0d301dbb2d (diff)
downloadraylib-a1038f61b60ad21c936af783facc91fe01607be3.tar.gz
raylib-a1038f61b60ad21c936af783facc91fe01607be3.zip
BPS type added to ensure consistency
Diffstat (limited to 'src/audio.h')
-rw-r--r--src/audio.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/audio.h b/src/audio.h
index cadf2bc1..28fe4b3c 100644
--- a/src/audio.h
+++ b/src/audio.h
@@ -45,8 +45,9 @@
typedef enum { false, true } bool;
#endif
#endif
-typedef enum { silence, mono, stereo } channel_t;
-typedef enum { mixA, mixB, mixC, mixD } mix_t; // Used for mixing/muxing up to four diferent audio streams
+typedef enum { silence, mono, stereo } channel_t; // number of audio sources per sample
+typedef enum { mixA, mixB, mixC, mixD } mix_t; // Used for mixing/muxing up to four diferent audio samples
+typedef enum { eightBPS, sixteenBPS } BPS; // Either 8 or 16 bit quality samples
// Sound source type
typedef struct Sound {
@@ -87,7 +88,7 @@ bool AudioDeviceReady(void); // True if call
// Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing
// The mix_t is what mix channel you want to operate on, mixA->mixD are the ones available. Each mix channel can only be used one at a time.
// exmple usage is InitAudioContext(48000, 16, mixA, stereo);
-AudioContext InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSample, mix_t mixChannel, channel_t channels);
+AudioContext InitAudioContext(unsigned short sampleRate, BPS bitsPerSample, mix_t mixChannel, channel_t channels);
void CloseAudioContext(AudioContext ctx); // Frees audio context
void UpdateAudioContext(AudioContext ctx, void *data, unsigned short *dataLength); // Pushes more audio data into context mix channel, if none are ever pushed then zeros are fed in