Sample? into variable

Hey all, I want to start by saying I’ve looked around for this, google, this form, etc. I think my main problem is I don’t know exactly what I’m looking for. Also, I know the title is a little bland/odd.

Anyways, I’ve programmed for years, but I’m attempting something that has to deal with music files specifically now and I’ve never worked with audio in programming.

  1. What’s the shortest piece of information in an audio file that gets directly translated to sound? Is it a sample?
    -My further questions will assume it’s sample:

  2. All samples are initially numbers in some form or another before they are converted to sound, how do I access that specific number so I can use it within my code?

  3. What files inside Audacity source code deal with this portion? I’d love to read through it.

If you have any reading material dealing in this subject, please point me in that direction also.

I’m trying to write a program that will compare each second against every other second, ultimately finding the chorus (school project) so my first step is finding how to turn each piece/sample into a numerical value for comparison.


If you are an advanced C+ programmer, this may be of interest:
If you are looking for something a lot more simple, perhaps you could develop something using Nyquist:

There is a simple Nyquist plug-in for reading individual audio samples here:

Some good links for Nyquist programming:

Thanks for the links! Looks like Proposal Audio Diff is exactly what I was looking for :slight_smile: I’ll start reading