File tree Expand file tree Collapse file tree
AudioMonitor/AudioMonitor Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66// Copyright © 2017 ArkPhone LLC. All rights reserved.
77//
88
9- // Use AudioConverter to resample audio to 48000 Hz, store in ring buffer,
10- // then provide data to AudioQueue to play with default audio device.
9+ // Receive input LPCM audio data at stdin, store in first TPCircularBuffer
10+ // Use AudioConverter to resample audio to 48000 Hz, store in second TPCircularBuffer, and output to stdout
11+ // then enqueue data to AudioQueue to play with default audio device.
1112
1213// Apparently, this code violates every rule listed here:
1314// http://atastypixel.com/blog/four-common-mistakes-in-audio-development/
2728#include < stdlib.h>
2829
2930
30- #define kInputMaxPackets (4 * 1024 )
3131#define kAudioQueueChannelsCount 1
3232#define kAudioQueueSampleRate 48000
3333
3434#define kInputPacketLength sizeof (SInt16)
3535
36- #define kAudioQueueBufferSize (kInputMaxPackets * sizeof (SInt16) * 2 )
36+ #define kInputMaxPackets 65536
37+ #define kAudioQueueBufferSize (kInputMaxPackets * sizeof (SInt16))
3738
3839@interface AudioMonitor ()
3940@end
You can’t perform that action at this time.
0 commit comments