Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- header* meta = new header;
- ifstream infile;
- infile.exceptions (ifstream::eofbit | ifstream::failbit | ifstream::badbit);
- infile.open("foo.wav", ios::in|ios::binary);
- infile.read ((char*)meta, sizeof(header));
- cout << " Header size: "<<sizeof(*meta)<<" bytes" << endl;
- cout << " Sample Rate "<< meta->sample_rate <<" Hz" << endl;
- cout << " Bits per samples: " << meta->bits_per_sample << " bit" <<endl;
- cout << " Number of channels: " << meta->num_channels << endl;
- cout << " Number of samples: " << numOfSample << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement