feature: Introduced c-style context pointer on AudioCallback
This commit is contained in:
parent
e46b6147fc
commit
48fc229d0c
1 changed files with 36 additions and 28 deletions
|
|
@ -35,7 +35,7 @@ float oldFrequency = 1.0f;
|
|||
float sineIdx = 0.0f;
|
||||
|
||||
// Audio input processing callback
|
||||
void AudioInputCallback(void *buffer, unsigned int frames)
|
||||
void AudioInputCallback(void *buffer, unsigned int frames, void *context)
|
||||
{
|
||||
audioFrequency = frequency + (audioFrequency - frequency)*0.95f;
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ int main(void)
|
|||
// Init raw audio stream (sample rate: 44100, sample size: 16bit-short, channels: 1-mono)
|
||||
AudioStream stream = LoadAudioStream(44100, 16, 1);
|
||||
|
||||
SetAudioStreamCallback(stream, AudioInputCallback);
|
||||
SetAudioStreamCallback(stream, AudioInputCallback, 0);
|
||||
|
||||
// Buffer for the single cycle waveform we are synthesizing
|
||||
short *data = (short *)malloc(sizeof(short)*MAX_SAMPLES);
|
||||
|
|
|
|||
Loading…
Reference in a new issue