Skip to content

Instantly share code, notes, and snippets.

@WLSF
Last active January 13, 2024 08:05
Show Gist options
  • Save WLSF/69e74a8230735eefa823628106cf4b0e to your computer and use it in GitHub Desktop.
Save WLSF/69e74a8230735eefa823628106cf4b0e to your computer and use it in GitHub Desktop.
#include <stdio.h>
#pragma warning(disable:4996)
struct WAV_FORMAT {
char riff[4];
int32_t file_size;
char wave[4];
char fmt[4];
int32_t data_length;
int16_t format_tag;
int16_t channels;
int32_t sample_rate;
int32_t bytes_per_second;
int16_t idk;
int16_t bits_per_sample;
char data[4];
int32_t data_size;
};
int main()
{
struct WAV_FORMAT wav;
FILE* fp;
fopen_s(&fp, "sound_name.wav", "r");
fread_s(&wav, sizeof(wav), 44, 1, fp);
fclose(fp);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment