Skip to content

Instantly share code, notes, and snippets.

View eyelash's full-sized avatar

eyelash

View GitHub Profile
@gcatlin
gcatlin / core-audio-sine-wave.c
Last active September 8, 2025 02:04
Core Audio sine wave example
// To run:
// clang core-audio-sine-wave.c -framework AudioUnit && ./a.out
#include <AudioUnit/AudioUnit.h>
#define SAMPLE_RATE 48000
#define TONE_FREQUENCY 440
#define M_TAU 2.0 * M_PI
OSStatus RenderSineWave(
void *inRefCon,
@fukuroder
fukuroder / wave_play_wasapi_shared.cpp
Last active July 8, 2021 06:38
wave file player (WASAPI shared mode)
/*
* wave_play_wasapi_shared.cpp
*
* Created by fukuroda (https://github.com/fukuroder)
*/
// windows API
#include <windows.h>
#include <audioclient.h>
#include <mmdeviceapi.h>
@andorthehood
andorthehood / main.c
Created November 12, 2011 18:00
Audio Queue example
#include <stdlib.h>
#include <math.h>
#include <AudioToolbox/AudioQueue.h>
#include <CoreAudio/CoreAudioTypes.h>
#include <CoreFoundation/CFRunLoop.h>
#define NUM_CHANNELS 2
#define NUM_BUFFERS 3