0

I've been working on c++ code that will take in sound and output it's core frequency, like a guitar tuner. I can generate my own randomized sine wave and successfully perform the FFT from a text file that is just amplitude vs. time. I just don't know how to produce usable data from either microphone or sound file.

Is there a simple way to sample sound and have it output the data in an amplitude vs. time text file?

I've looked into the WAV file format and how the various chunks work but it's a bit above my level. Any help is really appreciated.

1 Answers1

-1

If you can ensure that your WAV is mono, uncompressed, 16-bit and at a known sample rate, you can either skip the WAV/RIFF/whatever header or suck it in as if it were samples (that shouldn't affect your FFT results much if the file is long).

Other than that, uncompressed WAV isn't a horribly complex format. With some more effort you'll parse it.

Alexey Frunze
  • 61,140
  • 12
  • 83
  • 180