aboutsummaryrefslogtreecommitdiff
path: root/clak.c
blob: 5e947e978bacb73c0304d82b5357228a2175d463 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <stdio.h>

#include <windows.h>

#include "board/boards.h"
#define BOARD(str, buf) { .name = str, .wav = buf },

typedef struct {
	char *name;
	unsigned char* wav;
} Board;

Board boards[] = {
	BOARDS
};
int const boards_n = sizeof(boards) / sizeof(boards[0]);

int main(void)
{
	float volume = 0.05;
	DWORD channel_volume = volume * 0xFFFF;
	waveOutSetVolume(NULL, (channel_volume << 16) | channel_volume);

	for (int i = 0; i < boards_n; ++i) {
		printf("name: %s\n", boards[i].name);
		PlaySound((const char *) boards[i].wav, NULL, SND_MEMORY | SND_SYNC | SND_NODEFAULT);
		Sleep(500);
	}

	return 0;
}