Created
October 27, 2013 04:24
-
-
Save mntone/7177955 to your computer and use it in GitHub Desktop.
wave header
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_declspec( align( 1 ) ) | |
class wave_header | |
{ | |
public: | |
wave_header( void ): | |
format_size( 16 ), | |
format_id( 1 ), | |
channel( 1 ), | |
sample_rate( 44100 ), | |
bits_per_samples( 16 ), | |
bitrate( sample_rate * channel * bits_per_samples / 8 ), | |
block_size( channel * bits_per_samples / 8 ), | |
data_size( 0 ) | |
{ | |
memcpy( riff, "RIFF", 4 ); | |
memcpy( wave, "WAVE", 4 ); | |
memcpy( format, "fmt ", 4 ); | |
memcpy( data, "data", 4 ); | |
} | |
private: char riff[4]; | |
public: uint32_t total_size; | |
private: | |
char wave[4]; | |
char format[4]; | |
uint32_t format_size; | |
uint16_t format_id; | |
public: | |
uint16_t channel; | |
uint32_t sample_rate; | |
uint32_t bitrate; | |
uint16_t block_size; | |
uint16_t bits_per_samples; | |
private: char data[4]; | |
public: uint32_t data_size; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment