Skip to content

Instantly share code, notes, and snippets.

View konstantinpavlikhin's full-sized avatar

Konstantin Pavlikhin konstantinpavlikhin

View GitHub Profile
@konstantinpavlikhin
konstantinpavlikhin / XXXSpeakerDevice.m
Last active June 8, 2022 10:02
Using VoiceProcessingIO for echo cancellation on macOS
OSStatus MyOutputRenderCallback(void* inRefCon, AudioUnitRenderActionFlags* ioActionFlags, const AudioTimeStamp* inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList* ioData)
{
// Not being called at all.
}
@implementation XXXSpeakerDevice
{
AUGraph _graph;
}
# The style used for all options not specifically set in the configuration.
BasedOnStyle: LLVM
# The extra indent or outdent of access modifiers, e.g. public:.
AccessModifierOffset: 0
# If true, aligns escaped newlines as far left as possible. Otherwise puts them into the right-most column.
AlignEscapedNewlinesLeft: false
# If true, aligns trailing comments.
// ...import OpenSSL headers...
DSA* dsa = DSA_new();
const char *privateKey = [[NSString stringWithContentsOfFile: @"/private.pem"] UTF8String];
BIO* bio = BIO_new_mem_buf((void*)privateKey, -1);
PEM_read_bio_DSAPrivateKey(bio, &dsa, NULL, NULL);