Files: c2d33b90a4cc52d69bde0bb9c56ba78760ed9196 / src / audio_output.h
692 bytesRaw
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | class CoreAudioStream { |
9 | public: |
10 | typedef void (*callback)(void * context, short * samples, uint32_t count); |
11 | |
12 | private: |
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 | |
25 | public: |
26 | |
27 | CoreAudioStream(callback cb, void * userData, const uint32_t sampleRate); |
28 | ~CoreAudioStream(); |
29 | bool start(); |
30 | void close(); |
31 | }; |
32 | |
33 | |
34 | |
35 |
Built with git-ssb-web