git ssb

0+

kode54 / syntrax-c



Tree: c2d33b90a4cc52d69bde0bb9c56ba78760ed9196

Files: c2d33b90a4cc52d69bde0bb9c56ba78760ed9196 / src / audio_output.h

692 bytesRaw
1#ifndef _audio_output_h_
2#define _audio_output_h_
3
4#include <AudioToolbox/AudioQueue.h>
5
6#include <stdint.h>
7
8class CoreAudioStream {
9public:
10 typedef void (*callback)(void * context, short * samples, uint32_t count);
11
12private:
13 AudioQueueRef audioQueue;
14 AudioQueueBufferRef *buffers;
15 uint32_t numberOfBuffers;
16 uint32_t bufferByteSize;
17
18 uint32_t sampleRate;
19
20 callback playerCallback;
21 void * playerCallbackUserData;
22
23 static void renderOutputBuffer(void *userData, AudioQueueRef queue, AudioQueueBufferRef buffer);
24
25public:
26
27 CoreAudioStream(callback cb, void * userData, const uint32_t sampleRate);
28 ~CoreAudioStream();
29 bool start();
30 void close();
31};
32
33
34#endif
35

Built with git-ssb-web