How could I export an audio file to CSV file ?

I am using Audacity 2.0.6 on a Intel i7 based system running Windows 7 (and Windows 10). It has worked for me and If I knew I’d be able to do what I want to do now, I’d get the latest.

I record audio (sometimes ~8 hours long) using small recorders that record either WAV or MP3 format. I have opened them in Audacity and have no problem with that.

I want to be able to export the audio to a CSV format file (most anything text would be ok I believe). My goal is to parse the audio data file via software I write. I want to be able to programmatically search through sound data to look for extreme values, and perhaps other traits. To begin with, I’d want to parse the data to find average values for “silence”, then find values that are above a certain threshold (volume, maybe frequency … I will decide), and create a simple file showing the results. I’m a software developer, and will be fine once I get the audio into a CSV/text format.

I do not want to look at a Audacity graph of the sound - I want programmatic control of the data so I can manipulate it in various ways.

I have seen the “Sample data export”, however that does not fit the model I am operating within - where I leave small recorders in multiple locations, recording for up to 8 hours, for analysis at a later time.

Does anyone know if Audacity has such a feature, or what software I might use to accomplish this task.

I suppose I should apologize for lack of technical specifics. I am not certain of the precise format of my files (other then MP3/WAV).

Thanks for reading my question !

I’ve never tried it with Audacity (I’ve done something similar with GoldWave), but maybe [u]Sample Data Export[/u] will help.

Note that a file in a “text” formatted file will be MUCH larger than a typical “raw data” WAV file.

And, an 8-Hour WAV file will likely exceed the 4GB (or 2GB) [u]WAV file size limit[/u].

You might want to learn how to read WAV file directly (compressed data would be more difficult). There are libraries for reading samples from WAV files, or can write the code to do it yourself. It should be simple if you have a fixed-known WAV format (known bit-depth, number of channels, and sample rate). [u]WAV File Format[/u]

Or, you can try to learn MATLAB (or use one of the free MATLAB clones). It’s my understanding that MATLAB can read WAV files.

You will need to decide exactly what information about the file you want to have in your CSV file. It is impractical to export the sample data for an 8 hour recording simply because of the amount of data (for a mono track with a sample rate of 44100 Hz, the CSV file would be about 11 GB.)

A more practical approach might be to look at the peak, average, or RMS level at regular intervals (for example, at intervals of 0.1 seconds or more). This could be done by modifying the “Sample Data Export” plug-in so that it creates resamples the original audio prior to analyzing (see: http://www.cs.cmu.edu/~rbd/doc/nyquist/part8.html#index663)