I have verified that my frequency(note)
function returns the correct frequency as an int. However, when I attempt to write out using the "command-line note entry" testing scenario described (and yes i did hit ctrl-D to issue EOF), the .wav file that is output is nothing but the header and zero's trailing it
5249 4646 ac58 0100 5741 5645 666d 7420
1000 0000 0100 0100 44ac 0000 8858 0100
0200 1000 6461 7461 8858 0100 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
... to line 5516 ...
0000 0000
Testing the frequency function in isolation (in file temp.c
), just to verify
int frequency(string note);
int main(int argc, string argv[]){
if(argc != 2)
{
printf("Usage: %s NOTE\n", argv[0]);
return 1;
}
printf("%i", frequency(argv[1]));
}
int frequency(string note){ ... <code not shown> ... }
, here's the output:
~/workspace/ $ make temp
clang -fsanitize=signed-integer-overflow -fsanitize=undefined -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wshadow temp.c -lcrypt -lcs50 -lm -o temp
~/workspace/ $ ./temp A4
440~/workspace/ $
Any ideas?
Also this says pset3 on the 2018 cs50 site, but pset3 here looks like some puzzle game???