Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. header* meta = new header;
  2. ifstream infile;
  3. infile.exceptions (ifstream::eofbit | ifstream::failbit | ifstream::badbit);
  4. infile.open("foo.wav", ios::in|ios::binary);
  5.  
  6. infile.read ((char*)meta, sizeof(header));
  7.  
  8.  
  9. cout << " Header size: "<<sizeof(*meta)<<" bytes" << endl;
  10. cout << " Sample Rate "<< meta->sample_rate <<" Hz" << endl;
  11. cout << " Bits per samples: " << meta->bits_per_sample << " bit" <<endl;
  12. cout << " Number of channels: " << meta->num_channels << endl;
  13. cout << " Number of samples: " << numOfSample << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement