This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compile: cl minimal_wasapi.cpp /link ole32.lib | |
#include <windows.h> | |
#include <inttypes.h> | |
#include <math.h> | |
#include <mmdeviceapi.h> | |
#include <audioclient.h> | |
#define BYTES_PER_CHANNEL sizeof(float) | |
#define CHANNELS_PER_SAMPLE 1 | |
#define SAMPLES_PER_SECOND 44100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compile: cl music_box.cpp /link ole32.lib | |
// Usage: music_box.exe "Hello World" | |
#include <windows.h> | |
#include <inttypes.h> | |
#include <math.h> | |
#include <mmdeviceapi.h> | |
#include <audioclient.h> | |
#define BYTES_PER_CHANNEL sizeof(float) | |
#define CHANNELS_PER_SAMPLE 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <stdio.h> | |
struct DirectoryWatch | |
{ | |
char filePath[1024]; | |
char changeBuffer[65536]; | |
HANDLE directoryHandle; | |
FILE_NOTIFY_INFORMATION* nextChange; | |
}; |