Permalink
Fetching contributors…
Cannot retrieve contributors at this time
91 lines (68 sloc) 14.5 KB
module app;
import std.stdio;
import std.conv;
import std.format;
import derelict.fmod.fmod;
import derelict.fmodstudio.fmodstudio;
//super short simple wav (from http://download.wavetlan.com/SVV/Media/HTTP/http-wav.htm)
static immutable ubyte[2562] sound = [0x52,0x49,0x46,0x46,0xfa,0x9,0x0,0x0,0x57,0x41,0x56,0x45,0x66,0x6d,0x74,0x20,0x12,0x0,0x0,0x0,0x1,0x0,0x1,0x0,0x11,0x2b,0x0,0x0,0x11,0x2b,0x0,0x0,0x1,0x0,0x8,0x0,0x0,0x0,0x66,0x61,0x63,0x74,0x4,0x0,0x0,0x0,0xc8,0x9,0x0,0x0,0x64,0x61,0x74,0x61,0xc8,0x9,0x0,0x0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x7f,0x7f,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x7e,0x7f,0x80,0x80,0x7e,0x7e,0x7f,0x7f,0x7e,0x7d,0x7e,0x7e,0x7e,0x7d,0x7f,0x7e,0x7d,0x7e,0x7f,0x7f,0x7d,0x7f,0x81,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x84,0x85,0x84,0x81,0x80,0x80,0x83,0x7e,0x7a,0x7d,0x7e,0x7e,0x7c,0x7b,0x7f,0x7d,0x7a,0x7e,0x7f,0x7f,0x80,0x7e,0x7e,0x80,0x7f,0x82,0x82,0x81,0x82,0x82,0x86,0x85,0x84,0x8a,0x8d,0x8a,0x84,0x82,0x85,0x86,0x7f,0x79,0x7b,0x7c,0x79,0x77,0x78,0x7c,0x79,0x78,0x7c,0x7d,0x7d,0x7d,0x7c,0x7e,0x7c,0x7c,0x81,0x81,0x83,0x88,0x8b,0x8f,0x95,0x9d,0x9a,0x8d,0x84,0x85,0x8b,0x85,0x73,0x71,0x72,0x71,0x70,0x6c,0x6f,0x73,0x6d,0x6d,0x6f,0x71,0x76,0x73,0x6e,0x6f,0x74,0x81,0x8d,0x8e,0x95,0xa3,0xad,0xa7,0x97,0x91,0x98,0x96,0x84,0x77,0x7b,0x7d,0x7c,0x74,0x6f,0x6f,0x68,0x64,0x67,0x67,0x67,0x65,0x66,0x6e,0x75,0x7f,0x95,0xac,0xad,0xa1,0x95,0x94,0x9b,0x91,0x7e,0x7b,0x7f,0x83,0x86,0x7c,0x77,0x75,0x6f,0x6f,0x6b,0x66,0x6c,0x6e,0x6f,0x75,0x7b,0x94,0xa7,0x9d,0x92,0x8c,0x91,0x99,0x86,0x79,0x7d,0x7f,0x86,0x7c,0x73,0x77,0x71,0x6f,0x6c,0x65,0x67,0x69,0x6a,0x73,0x78,0x8c,0xa8,0xa7,0x9d,0x93,0x90,0x98,0x8d,0x78,0x7a,0x7c,0x80,0x80,0x72,0x72,0x77,0x72,0x6f,0x67,0x68,0x6d,0x6e,0x71,0x7e,0x94,0xa5,0x9f,0x92,0x91,0x9e,0x9c,0x87,0x7e,0x87,0x8e,0x89,0x78,0x75,0x7b,0x79,0x72,0x6b,0x6b,0x71,0x75,0x78,0x8a,0x9f,0x9f,0x96,0x8c,0x94,0xa3,0x8e,0x7b,0x80,0x87,0x91,0x82,0x76,0x7b,0x77,0x77,0x77,0x6e,0x72,0x76,0x78,0x88,0x9e,0xa3,0x99,0x8b,0x85,0x9a,0x9c,0x7e,0x78,0x7d,0x85,0x86,0x70,0x72,0x7a,0x73,0x74,0x6f,0x71,0x79,0x74,0x80,0x9c,0xa3,0x96,0x87,0x83,0x9a,0x8f,0x75,0x77,0x76,0x7e,0x7d,0x6b,0x6e,0x6c,0x6a,0x75,0x71,0x76,0x79,0x7e,0x9f,0xa2,0x8f,0x85,0x82,0x96,0x8e,0x73,0x7b,0x7a,0x7a,0x7a,0x69,0x6b,0x68,0x65,0x74,0x71,0x74,0x7b,0x83,0xa1,0xa7,0x90,0x88,0x84,0x96,0x91,0x78,0x7c,0x78,0x78,0x7b,0x6a,0x6b,0x66,0x65,0x75,0x74,0x70,0x79,0x8a,0xa6,0xa0,0x86,0x7f,0x8c,0x9a,0x87,0x76,0x7a,0x7a,0x80,0x79,0x6b,0x6a,0x65,0x6b,0x76,0x70,0x72,0x7f,0x94,0xa4,0x93,0x86,0x86,0x94,0x92,0x7f,0x7c,0x7a,0x7b,0x7d,0x74,0x6e,0x68,0x67,0x74,0x76,0x75,0x7b,0x8c,0xa0,0x99,0x85,0x84,0x8f,0x98,0x87,0x78,0x78,0x7c,0x80,0x74,0x6f,0x6d,0x6d,0x75,0x74,0x77,0x7a,0x88,0xa0,0x9c,0x8c,0x85,0x86,0x9a,0x8f,0x76,0x76,0x75,0x83,0x7e,0x69,0x69,0x6e,0x76,0x76,0x6e,0x77,0x8e,0x9e,0x99,0x8b,0x85,0x8c,0x99,0x8e,0x7b,0x79,0x79,0x85,0x83,0x70,0x71,0x73,0x75,0x7a,0x72,0x73,0x85,0x98,0x9b,0x8b,0x81,0x85,0x99,0x98,0x7b,0x73,0x7a,0x81,0x8a,0x77,0x6e,0x76,0x77,0x77,0x74,0x70,0x7b,0x91,0x98,0x89,0x80,0x7e,0x91,0x95,0x75,0x73,0x7c,0x81,0x8b,0x72,0x6d,0x7e,0x7a,0x78,0x70,0x6f,0x85,0x94,0x93,0x87,0x7c,0x7e,0x8d,0x92,0x78,0x6b,0x72,0x7f,0x8e,0x7d,0x70,0x7c,0x7d,0x80,0x76,0x6a,0x7c,0x8b,0x96,0x8f,0x7c,0x7a,0x83,0x93,0x89,0x71,0x72,0x76,0x8a,0x89,0x77,0x7c,0x7d,0x7e,0x83,0x71,0x75,0x88,0x96,0x93,0x7d,0x72,0x7f,0x9a,0x87,0x6d,0x70,0x74,0x94,0x87,0x74,0x7b,0x7a,0x88,0x87,0x76,0x81,0x8f,0x94,0x87,0x7a,0x77,0x8d,0x90,0x73,0x71,0x6d,0x7c,0x8c,0x75,0x7a,0x79,0x7c,0x89,0x7c,0x81,0x88,0x8d,0x93,0x7f,0x79,0x7c,0x91,0x8d,0x75,0x71,0x71,0x82,0x89,0x77,0x84,0x7b,0x7b,0x84,0x7f,0x92,0x99,0x8b,0x80,0x7b,0x7f,0x9b,0x8b,0x72,0x77,0x72,0x8a,0x87,0x70,0x88,0x7e,0x83,0x89,0x78,0x97,0xa4,0x87,0x80,0x77,0x8d,0xaa,0x71,0x67,0x79,0x75,0x95,0x6d,0x67,0x87,0x7d,0x8e,0x7b,0x70,0x9c,0x9f,0x88,0x86,0x7d,0x95,0xa6,0x6b,0x6d,0x85,0x7f,0x93,0x6d,0x6a,0x8e,0x82,0x8d,0x7b,0x70,0x94,0x9e,0x91,0x84,0x74,0x7f,0x9d,0x80,0x73,0x75,0x72,0x86,0x80,0x73,0x87,0x7a,0x81,0x80,0x74,0x88,0x94,0x8b,0x7c,0x76,0x72,0x8f,0x8d,0x6f,0x6c,0x69,0x82,0x96,0x66,0x6f,0x80,0x70,0x7f,0x99,0xa5,0x68,0x60,0xac,0x96,0x7c,0x6e,0x62,0x72,0x71,0x8e,0x83,0x3a,0x77,0xae,0x72,0x62,0x83,0xb3,0xa6,0x5e,0x93,0xaf,0x6b,0x88,0x82,0x67,0x6c,0x66,0x83,0x6c,0x48,0x94,0x96,0x5c,0x7c,0x96,0xb0,0xab,0x6a,0x89,0xa6,0x74,0x98,0x76,0x50,0x76,0x7a,0x78,0x72,0x4c,0x83,0x96,0x66,0x7c,0x86,0x9e,0xb7,0x72,0x76,0xaf,0x82,0x8c,0x6c,0x5e,0x6e,0x70,0x82,0x65,0x48,0x82,0x94,0x5a,0x7a,0xb9,0xaa,0x64,0x89,0xc8,0x87,0x63,0x79,0x87,0x5f,0x5e,0x84,0x52,0x47,0xa1,0x92,0x46,0x73,0xb1,0xc1,0xa8,0x65,0xa6,0xc8,0x8b,0x7d,0x65,0x6c,0x80,0x5f,0x58,0x4a,0x58,0xa6,0x80,0x47,0x8a,0xb4,0xc6,0x9b,0x60,0xb4,0xc6,0x8d,0x71,0x62,0x85,0x78,0x6d,0x64,0x45,0x6b,0xa9,0x69,0x4c,0x93,0xc1,0xbc,0x6b,0x6b,0xc1,0xaf,0x84,0x64,0x61,0x7e,0x86,0x75,0x4b,0x4b,0x85,0x97,0x55,0x5b,0xa5,0xc7,0x8c,0x5f,0xbe,0xc1,0x7b,0x69,0x80,0x7b,0x68,0x76,0x66,0x3f,0x70,0xa9,0x63,0x4a,0x8d,0xb0,0xc7,0x86,0x63,0xc4,0xc0,0x7c,0x60,0x6e,0x81,0x62,0x5a,0x4f,0x43,0x82,0xa5,0x56,0x52,0x9b,0xb9,0xc1,0x72,0x68,0xc9,0xb7,0x78,0x55,0x60,0x93,0x7f,0x59,0x56,0x50,0x82,0xa4,0x55,0x4e,0xa3,0xc6,0xa7,0x57,0x81,0xd0,0x95,0x61,0x69,0x85,0x7c,0x75,0x6c,0x49,0x55,0x92,0x8e,0x4c,0x79,0xcc,0xb3,0x61,0x88,0xd9,0x9e,0x63,0x78,0x92,0x73,0x77,0x67,0x44,0x5d,0x9e,0x82,0x42,0x6f,0xa0,0xb7,0xc1,0x72,0x6f,0xd4,0xbc,0x66,0x56,0x99,0x98,0x59,0x4d,0x56,0x5b,0x91,0x98,0x47,0x57,0xa2,0xbc,0xbc,0x6f,0x64,0xc9,0xc3,0x73,0x4c,0x7e,0xa5,0x72,0x4f,0x5e,0x6d,0x98,0x96,0x4e,0x6a,0xac,0xbd,0xa8,0x5d,0x7d,0xcc,0x97,0x5e,0x56,0x8d,0x94,0x63,0x4e,0x5c,0x7c,0x99,0x71,0x52,0xa9,0xd2,0x84,0x5f,0xbc,0xc9,0x7f,0x62,0x8d,0x88,0x7a,0x6a,0x53,0x5c,0x8f,0x8f,0x4e,0x63,0xac,0xca,0xa3,0x59,0xa1,0xe0,0x99,0x54,0x79,0xaa,0x7c,0x59,0x4e,0x64,0x7f,0x93,0x63,0x4f,0x8d,0xa0,0xa7,0xb2,0x69,0x72,0xcd,0xa2,0x54,0x59,0x9c,0x8c,0x57,0x58,0x76,0x7a,0x92,0x6e,0x48,0x94,0xbe,0xa7,0x5c,0x68,0xc3,0xa4,0x53,0x5a,0x9f,0x8f,0x5f,0x4f,0x5f,0x7d,0x90,0x73,0x43,0x7a,0xbc,0xbb,0x72,0x53,0xb7,0xc5,0x6c,0x54,0x9e,0xa2,0x6a,0x4f,0x60,0x70,0x8a,0x79,0x41,0x6c,0xa9,0xb2,0xa2,0x64,0x7a,0xcf,0x9c,0x4d,0x70,0xb5,0x88,0x46,0x56,0x7c,0x79,0x80,0x6a,0x4e,0x7d,0xa0,0x8d,0xaa,0x88,0x68,0xba,0xaa,0x60,0x57,0x93,0x95,0x5e,0x4f,0x73,0x7a,0x7c,0x78,0x50,0x71,0xa6,0xae,0x88,0x50,0x9a,0xc0,0x6a,0x49,0x91,0xa6,0x61,0x49,0x69,0x80,0x81,0x80,0x55,0x58,0xaa,0xc7,0x8e,0x4d,0x98,0xd3,0x88,0x49,0x81,0xb7,0x78,0x4e,0x56,0x77,0x8f,0x7c,0x46,0x63,0xa4,0x9a,0x9d,0xa3,0x6d,0x9c,0xc9,0x78,0x50,0x96,0xac,0x5b,0x4c,0x81,0x85,0x6e,0x7d,0x6d,0x65,0x97,0xa9,0xac,0x85,0x6a,0xbd,0xa9,0x5d,0x63,0x9e,0x8e,0x5c,0x5e,0x72,0x84,0x87,0x7a,0x5a,0x7b,0xa2,0x97,0xa0,0x85,0x73,0xab,0xa4,0x6b,0x60,0x89,0x8b,0x5d,0x55,0x70,0x78,0x73,0x6e,0x5e,0x79,0xac,0xb3,0x75,0x5c,0xb3,0xba,0x66,0x53,0x9b,0xa3,0x60,0x50,0x71,0x80,0x7a,0x66,0x54,0x7e,0x9a,0x91,0xa7,0x90,0x70,0xb6,0xb2,0x61,0x61,0xa8,0x90,0x4c,0x59,0x81,0x73,0x6e,0x76,0x65,0x75,0x92,0x8f,0xa4,0xa3,0x6f,0x98,0xb7,0x78,0x5a,0x86,0x94,0x62,0x5b,0x78,0x84,0x79,0x78,0x68,0x76,0x92,0x91,0x9e,0x8e,0x66,0x97,0xb3,0x76,0x58,0x8b,0x97,0x5f,0x54,0x80,0x8a,0x71,0x6f,0x71,0x7e,0x92,0xa5,0xa4,0x77,0x7d,0xbd,0x9f,0x5e,0x6e,0xa4,0x82,0x51,0x61,0x7d,0x73,0x69,0x62,0x6b,0x8b,0x89,0x8b,0xaf,0x97,0x72,0xaf,0xa8,0x60,0x6f,0xa5,0x7b,0x4a,0x6b,0x7f,0x62,0x65,0x79,0x76,0x7e,0x8b,0x82,0xa1,0xb6,0x7a,0x7b,0xb7,0x8c,0x5d,0x7a,0x91,0x69,0x63,0x7f,0x7a,0x71,0x7e,0x75,0x72,0x93,0xad,0x9b,0x60,0x94,0xbf,0x72,0x58,0x9b,0x95,0x5b,0x6f,0x87,0x7b,0x76,0x82,0x75,0x82,0x98,0x82,0xa2,0xb1,0x6e,0x8f,0xc1,0x85,0x5c,0x8f,0x98,0x5c,0x65,0x81,0x70,0x71,0x80,0x71,0x83,0x91,0x7f,0xa7,0xb4,0x75,0x89,0xbb,0x95,0x65,0x7a,0x9b,0x6b,0x59,0x76,0x70,0x71,0x81,0x76,0x77,0x89,0x87,0x9d,0xaa,0x71,0x78,0xae,0x88,0x58,0x70,0x91,0x67,0x56,0x70,0x70,0x6f,0x81,0x7b,0x71,0x80,0x88,0x9a,0xa8,0x71,0x61,0xaf,0xa3,0x56,0x57,0x9f,0x86,0x4b,0x6e,0x8c,0x74,0x71,0x79,0x72,0x7f,0x9b,0xad,0x8c,0x61,0xa6,0xb8,0x67,0x57,0x9f,0x97,0x53,0x5f,0x83,0x78,0x6a,0x6f,0x72,0x82,0x87,0x71,0x84,0xb8,0xa8,0x62,0x93,0xc7,0x81,0x54,0x8f,0x9b,0x59,0x59,0x71,0x6f,0x72,0x72,0x6f,0x76,0x80,0x82,0x93,0xaa,0x76,0x6f,0xb4,0x93,0x54,0x6d,0xa2,0x73,0x51,0x69,0x81,0x7b,0x77,0x77,0x7a,0x91,0x88,0x6f,0x89,0xac,0x91,0x56,0x87,0xaf,0x73,0x53,0x81,0x96,0x66,0x5e,0x83,0x86,0x81,0x7b,0x76,0x84,0x89,0x7d,0x90,0xab,0x7d,0x68,0xae,0xa1,0x63,0x6b,0x9d,0x86,0x5f,0x79,0x87,0x7b,0x7b,0x79,0x76,0x7d,0x78,0x73,0x98,0xb1,0x70,0x6a,0xbb,0x9d,0x57,0x76,0xa9,0x71,0x56,0x7f,0x7c,0x6a,0x71,0x6f,0x72,0x7d,0x71,0x74,0x93,0xac,0x8f,0x63,0x98,0xb7,0x77,0x5f,0x94,0x97,0x69,0x64,0x75,0x82,0x83,0x6f,0x6b,0x85,0x91,0x7b,0x7b,0xa8,0x9d,0x68,0x86,0xaa,0x83,0x5e,0x7b,0x94,0x72,0x69,0x79,0x7e,0x87,0x7f,0x75,0x7d,0x7f,0x78,0x90,0xa7,0x7a,0x5a,0xa2,0xab,0x66,0x5e,0x9b,0x8a,0x5b,0x77,0x84,0x74,0x7a,0x7b,0x6f,0x7a,0x89,0x79,0x83,0xa8,0x86,0x65,0xa6,0xac,0x6c,0x67,0x9e,0x8c,0x5c,0x75,0x83,0x65,0x6b,0x7b,0x71,0x74,0x79,0x76,0x7b,0x89,0xaa,0x92,0x60,0x93,0xbc,0x84,0x5a,0x8c,0xa2,0x6b,0x60,0x7b,0x7d,0x70,0x6a,0x73,0x7c,0x84,0x7b,0x7a,0x8f,0xaa,0x9a,0x65,0x90,0xbb,0x85,0x5b,0x89,0xa9,0x71,0x5d,0x84,0x8d,0x72,0x6c,0x7b,0x7d,0x7f,0x75,0x75,0x95,0xa2,0x67,0x79,0xb4,0x8e,0x5c,0x7f,0xa1,0x71,0x62,0x7c,0x80,0x75,0x75,0x7b,0x79,0x7e,0x78,0x77,0x92,0xab,0x74,0x6c,0xb9,0xa1,0x60,0x78,0xac,0x84,0x5d,0x79,0x89,0x70,0x6e,0x7a,0x74,0x76,0x79,0x79,0x7b,0x91,0xaf,0x7f,0x6e,0xb6,0xa8,0x66,0x78,0xac,0x80,0x59,0x80,0x85,0x68,0x6e,0x76,0x77,0x7e,0x7c,0x77,0x85,0x96,0xa3,0x9d,0x79,0x91,0xb3,0x91,0x6e,0x8b,0x9a,0x75,0x68,0x7f,0x7e,0x73,0x74,0x78,0x7c,0x7c,0x7f,0x80,0x7c,0x95,0xae,0x85,0x67,0xa8,0xb3,0x6f,0x6a,0xa4,0x87,0x5d,0x77,0x82,0x71,0x70,0x6f,0x70,0x80,0x79,0x68,0x77,0x9f,0xaa,0x76,0x69,0xb5,0xa4,0x5c,0x79,0xae,0x78,0x57,0x7f,0x82,0x69,0x69,0x6e,0x73,0x7b,0x74,0x71,0x78,0x89,0x9f,0x99,0x6a,0x8e,0xb4,0x7d,0x67,0x97,0x95,0x65,0x6b,0x85,0x74,0x62,0x6b,0x77,0x72,0x70,0x72,0x79,0x78,0x7b,0x94,0xa6,0x7d,0x72,0xb0,0x9f,0x65,0x7c,0xa5,0x80,0x60,0x7a,0x7e,0x6b,0x68,0x70,0x73,0x72,0x70,0x73,0x7a,0x7a,0x90,0xa2,0x83,0x73,0xa6,0xa6,0x70,0x74,0xa1,0x8c,0x62,0x72,0x87,0x70,0x62,0x6e,0x75,0x71,0x6d,0x74,0x7b,0x7f,0x82,0x96,0xa3,0x7d,0x83,0xaf,0x92,0x73,0x90,0x9a,0x75,0x6f,0x86,0x75,0x66,0x74,0x78,0x70,0x70,0x72,0x80,0x85,0x78,0x84,0xa8,0x9a,0x6e,0x93,0xaf,0x84,0x72,0x94,0x8e,0x71,0x75,0x7a,0x74,0x71,0x71,0x71,0x76,0x78,0x78,0x79,0x7b,0x82,0x88,0x9d,0x99,0x74,0x8f,0xaf,0x88,0x70,0x8e,0x93,0x71,0x70,0x80,0x75,0x6c,0x70,0x75,0x78,0x78,0x72,0x7c,0x84,0x7d,0x7e,0x8e,0x9f,0x90,0x75,0x94,0xa4,0x80,0x73,0x8e,0x8f,0x72,0x74,0x7e,0x76,0x6f,0x74,0x7c,0x77,0x70,0x79,0x85,0x79,0x72,0x80,0x91,0x9c,0x84,0x6e,0x96,0xa6,0x7e,0x72,0x90,0x91,0x74,0x75,0x7e,0x78,0x76,0x75,0x72,0x74,0x7c,0x79,0x73,0x78,0x7d,0x80,0x82,0x8a,0x95,0x84,0x7d,0x9a,0x95,0x78,0x84,0x94,0x7f,0x74,0x82,0x80,0x71,0x73,0x78,0x78,0x72,0x70,0x72,0x75,0x7b,0x7b,0x78,0x82,0x95,0x93,0x7d,0x81,0x9f,0x96,0x76,0x82,0x99,0x84,0x76,0x88,0x80,0x6f,0x79,0x7d,0x70,0x6f,0x79,0x79,0x74,0x76,0x7c,0x7e,0x7e,0x83,0x95,0x92,0x7d,0x89,0xa1,0x8a,0x77,0x8a,0x91,0x7b,0x71,0x81,0x7e,0x6b,0x6f,0x79,0x76,0x6d,0x74,0x7b,0x76,0x74,0x7a,0x80,0x81,0x83,0x90,0x94,0x87,0x89,0x99,0x96,0x83,0x84,0x8c,0x88,0x7c,0x7b,0x80,0x78,0x71,0x78,0x7c,0x74,0x76,0x7d,0x7d,0x7a,0x7c,0x81,0x82,0x82,0x89,0x94,0x93,0x8e,0x96,0x9d,0x8d,0x86,0x90,0x8b,0x7f,0x7b,0x81,0x80,0x76,0x73,0x78,0x7a,0x7b,0x79,0x7a,0x7f,0x80,0x80,0x82,0x84,0x85,0x89,0x94,0x96,0x8e,0x8b,0x95,0x96,0x88,0x80,0x89,0x88,0x78,0x75,0x7d,0x79,0x73,0x74,0x78,0x77,0x78,0x79,0x78,0x7b,0x7f,0x7e,0x7e,0x81,0x82,0x80,0x82,0x8a,0x8e,0x87,0x81,0x8c,0x8f,0x80,0x7b,0x85,0x80,0x74,0x75,0x78,0x72,0x6e,0x73,0x74,0x72,0x75,0x7a,0x7d,0x83,0x83,0x80,0x7e,0x82,0x82,0x80,0x84,0x8a,0x8a,0x84,0x83,0x87,0x88,0x84,0x7d,0x7f,0x7f,0x7a,0x77,0x77,0x74,0x74,0x75,0x74,0x73,0x76,0x7e,0x80,0x7e,0x81,0x84,0x81,0x80,0x80,0x84,0x83,0x7e,0x80,0x88,0x87,0x81,0x7f,0x85,0x85,0x7e,0x7d,0x80,0x7d,0x79,0x78,0x77,0x77,0x76,0x75,0x77,0x7b,0x7a,0x78,0x7f,0x83,0x7e,0x80,0x83,0x83,0x80,0x80,0x81,0x82,0x81,0x7f,0x80,0x85,0x84,0x80,0x81,0x86,0x82,0x7d,0x80,0x82,0x7d,0x7b,0x7f,0x7e,0x78,0x77,0x7b,0x7c,0x7a,0x7b,0x7f,0x80,0x80,0x80,0x81,0x83,0x84,0x82,0x81,0x83,0x83,0x81,0x82,0x84,0x85,0x83,0x83,0x86,0x86,0x83,0x82,0x83,0x80,0x7d,0x7c,0x7d,0x7a,0x78,0x7a,0x7a,0x7b,0x7b,0x7c,0x7f,0x80,0x7f,0x81,0x83,0x83,0x83,0x84,0x84,0x84,0x83,0x82,0x82,0x83,0x85,0x84,0x81,0x82,0x83,0x83,0x81,0x7f,0x7f,0x7e,0x7d,0x7d,0x7c,0x7a,0x7b,0x7c,0x7c,0x7b,0x7c,0x7e,0x7f,0x7f,0x7f,0x80,0x80,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x80,0x80,0x80,0x80,0x7f,0x7e,0x7e,0x7e,0x7d,0x7d,0x7e,0x7e,0x7d,0x7d,0x7e,0x7e,0x7f,0x7e,0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x5d];
FMOD_SYSTEM* fmod;
void printDrivers()
{
int drivercnt;
FMOD_System_GetNumDrivers(fmod, &drivercnt);
writefln("fmod drivers: %s",drivercnt);
foreach(i; 0..drivercnt)
{
char[64] name;
FMOD_GUID guid;
int sampleRate;
FMOD_SPEAKERMODE speakermode;
int speakermodeChannels;
auto res = FMOD_System_GetDriverInfo(fmod,i,name.ptr,name.length,&guid,&sampleRate,&speakermode,&speakermodeChannels);
assert(res == FMOD_OK);
writefln("fmod driver [%s]: (%s,%s,%s,'%s')",i,sampleRate,speakermode,speakermodeChannels,to!string(name.ptr));
}
}
void playSound()
{
FMOD_SOUND* snd;
FMOD_CHANNEL* channel;
FMOD_CREATESOUNDEXINFO info;
info.cbsize = FMOD_CREATESOUNDEXINFO.sizeof;
info.length = cast(uint)sound.length;
auto res = FMOD_System_CreateSound(fmod, cast(char*)sound.ptr, FMOD_OPENMEMORY, &info, &snd);
assert(res == FMOD_OK);
res = FMOD_System_PlaySound(fmod, snd, null, false, &channel);
assert(res == FMOD_OK);
assert(channel);
import core.thread:Thread;
import std.datetime:dur;
Thread.sleep( dur!("seconds")( 1 ) );
}
void printVersion()
{
uint fmodversion;
auto res = FMOD_System_GetVersion(fmod,&fmodversion);
assert(res == FMOD_OK);
writefln("fmod version: %s (bindings: %s)",fmodversion, FMOD_VERSION);
}
void main()
{
DerelictFmod.load();
DerelictFmodStudio.load();
FMOD_Debug_Initialize(FMOD_DEBUG_LEVEL_LOG | FMOD_DEBUG_DISPLAY_TIMESTAMPS | FMOD_DEBUG_TYPE_TRACE,
FMOD_DEBUG_MODE_FILE, null, "dbg.log");
// create fmod system
auto res = FMOD_System_Create(&fmod);
assert(res == FMOD_OK);
printVersion();
printDrivers();
// init fmod system
res = FMOD_System_Init(fmod, 32, FMOD_INIT_NORMAL, null);
assert(res == FMOD_OK);
playSound();
FMOD_System_Close(fmod);
FMOD_System_Release(fmod);
DerelictFmod.unload();
}