oh, this is a commit !

This commit is contained in:
2020-12-12 04:13:54 +01:00
parent 499944159f
commit 7722aef9d3
10 changed files with 98 additions and 34 deletions

View File

@@ -25,15 +25,11 @@ float freq = 440.0;
int i;
/* -- Initialize -- */
fprintf(stderr, "libao example program\n");
ao_initialize();
/* -- Setup for default driver -- */
default_driver = ao_default_driver_id();
memset(&format, 0, sizeof(format));
format.bits = 16;
format.channels = 2;
@@ -54,7 +50,6 @@ buffer = calloc(buf_size, sizeof(char));
for (i = 0; i < format.rate; i++) {
sample = (int)(0.75 * 32768.0 *
sin(2 * M_PI * freq * ((float) i/format.rate)));
/* Put the same stuff in left and right channel */
buffer[4*i] = buffer[4*i+2] = sample & 0xff;
buffer[4*i+1] = buffer[4*i+3] = (sample >> 8) & 0xff;

3
code/midifile.pl Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/perl -w
use MIDI;
0;