I was bored, so I wrote something that could turn .wav files in to .bmps:
#include <stdio.h>
char bmp[12000029]; // Need 12000028 bits, 1 pixel is 3
// bits and table is 28 (1500^2 * 3 + 28)
int main() {
bmp[0] = 0x42; // Bitmap signature
bmp[1] = 0x4D; // 'BM'
bmp[2] = 0x1C; //
bmp[3] = 0x1B; // Size of bitmap
bmp[4] = 0xB7; // in bytes
bmp[5] = 0x00; //
bmp[10] = 0x1A; // Image data location
bmp[14] = 0x0C; // Size of header
bmp[18] = 0xDC; //
bmp[19] = 0x05; // Dimensions of image
bmp[20] = 0xDC; // 1500 * 1500
bmp[21] = 0x05; //
bmp[22] = 0x01; // Something
bmp[24] = 0x18; // standard (?)
FILE *fp;
fp = fopen("file.wav", "rb");
if (fp == NULL) {
printf("Error opening 'file.wav'\n");
return 1;
}
for (int i = 41; i < 12000043; i++) { // Actual music data starts at 41
bmp[i - 15] = fgetc(fp); // Store first data to bmp[26] (41 - 15)
}
fclose(fp);
fp = fopen("file.bmp", "w+");
for (int i = i; i < 12000028; i++) {
fputc(bmp[i], fp);
}
fclose(fp);
return 0;
}
I know this is probably the most random thing ever, but it is quite intriguing in my opinion.
(You just got Rickroll'd).