Add: Mixer feature for streaming sampled music
This commit is contained in:
10
src/mixer.h
10
src/mixer.h
@@ -14,6 +14,14 @@
|
||||
|
||||
struct MixerChannel;
|
||||
|
||||
/**
|
||||
* Type of callback functions for supplying PCM music.
|
||||
* A music decoder/renderer implements this function and installs it with MxSetMusicSource, which also returns the sample rate used.
|
||||
* @param buffer Pointer to interleaved 2-channel signed 16 bit PCM data buffer, guaranteed to be 0-initialized.
|
||||
* @param samples number of samples that must be filled into \c buffer.
|
||||
*/
|
||||
typedef void(*MxStreamCallback)(int16 *buffer, size_t samples);
|
||||
|
||||
bool MxInitialize(uint rate);
|
||||
void MxMixSamples(void *buffer, uint samples);
|
||||
|
||||
@@ -22,4 +30,6 @@ void MxSetChannelRawSrc(MixerChannel *mc, int8 *mem, size_t size, uint rate, boo
|
||||
void MxSetChannelVolume(MixerChannel *mc, uint volume, float pan);
|
||||
void MxActivateChannel(MixerChannel*);
|
||||
|
||||
uint32 MxSetMusicSource(MxStreamCallback music_callback);
|
||||
|
||||
#endif /* MIXER_H */
|
||||
|
Reference in New Issue
Block a user