Skip to content

Instantly share code, notes, and snippets.

View alan23273850's full-sized avatar

Wei-Lun Tsai alan23273850

  • Academia Sinica
  • Taipei, Taiwan
View GitHub Profile
@mhamilt
mhamilt / wasapi-console.cpp
Last active April 2, 2025 01:57
WASAPI simple console application to play a sine wave
//-----------------------------------------------------------
// Play an audio stream on the default audio rendering
// device. The PlayAudioStream function allocates a shared
// buffer big enough to hold one second of PCM audio data.
// The function uses this buffer to stream data to the
// rendering device. The inner loop runs every 1/2 second.
//-----------------------------------------------------------
#include <iostream>
#include <windows.h>