I am trying to convert my recorded sound wave on Audacity, into a numerical form (a bit like a list of x,y coordinates) and import this into an Excel spreadsheet, and/or Python. Is there any way I can do this? I’m sure there must be some sort of technique which would allow me to just capture the audio as a text file but not exactly sure how! Secondly, is there any way to convert a bunch of coordinates into something that Audacity can read and play back to me as sound? Many thanks!
Note that for the default sample rate of 44100, there are 44100 samples per audio channel each second. Each character in a text or csv file requires (at least) one byte of data, so 1 second of mono audio will produce over 366 KB of text data.
Hi,
Thanks so much.
Just a quick follow up.
When I try to export time indexed data I get two duplicate columns of the ‘y value’ rather than one column with the x values. Are you aware of how I could troubleshoot this?
With the import, I am getting an error message that says ‘The file must contain only plain ASCII text. Invalid byte 255 at byte number:1’
Any ideas what this means?
Are you sure?
Try selecting some absolute silence (“Generate menu > Silence”).
When it is a mono track with a sample rate of 44100, the exported data should look like this:
Hi steve,
Is it possible I could speak to you over phone/verbally?
As it will take quite a long time to communicate on the forum. No worries if that isn’t possible.
Hi steve,
Is it possible I could speak to you over phone/verbally?
As it will take quite a long time to communicate on the forum. No worries if that isn’t possible.
In answer to the first post - No I don’t get that, I get a single column of zeros
A lot of songs have silence in the beginning so it wouldn’t be unusual to get several thousand zeros before you get to the audio. Try selecting some audio where you can see the wave instead of starting at the beginning.
I’ve never programmed in Python but it should be simple to open a WAV file. A [u]WAV file[/u] is simply a header followed by a series of “Y” values (the amplitude at one instant in time).
The header contains the number of bits per sample and the number of samples so the software knows how to convert the bytes to sample values and separate left from right in a stereo file. The 'X" values are implied by the sample rate (samples per second).
Sure no worries Steve I understand.
Settings as follows:
1000, Linear, (File Pathway), Time Indexed, None, Blank, L-R on same Line, Yes.
We can deal with the import issues after this.
Here is document I am trying to import but which brings up the aforementioned error message. The export is now working. Audacity Test Import.txt (33.7 KB)