Audacity 2.0.3 Can't figure out "sample data export" feature


I want to convert a music file into raw data such as a txt file, and I believe the “Sample data export” feature does exactly this. But I just can’t figure out how to use this feature… When I try to use that feature with default settings, I get an error message that says something along the lines of “Nyquist is Latin-1. Some incorrect UTF-8 characters have been converted.” Any suggestion on how to make this work would be greatly appreciated!

Unfortunately the plug-in author is on vacation, but are you importing a file to analyze, if so what is the complete path to that file (its file name and the names of the folders the file is in)?

Are your Region and Language “Format” options in Windows set to other than English?

Please press the “Debug” option in Sample Data Export instead of “OK”, then post the debug output from the window that says “Nyquist Output”. You can right-click in that window then choose Select All, then right-click again > Copy.


Hi Gale,

As you suspected, the complete path to that file contained a language other than English. After I changed the path so that English is the only language that is included, everything worked out. Thank you so much!

I have another question, though. I tried taking 1M samples (which I believe is the maximum) for an mp3 file that is 5 minutes and 15 seconds long and only got data for 22.67 seconds. Is there a way for me to get data for the entire file? (The only solution that I can think of at the moment is deleting the first 22.67 seconds in Audacity, taking another batch of 1M samples, and repeating this process until I have data for the entire file. But I’m wondering if there is a better method.) Thank you in advance!

OK. So I am clear, was that a problem with the path of the file you were writing the sample data to, or a problem with the path of a file you had imported it into Audacity?

Certainly I cannot write to a folder with a path S:é on Windows 7, but I was not aware of that limitation.

At 44100 Hz project rate, 1 million audio samples is 22.676 seconds (Hz means samples per second, so 1000000 samples divided by 44100 rate gives you 22.676 seconds to three decimal places).

If you want you can open sample-data-export.ny in Notepad, turn word wrap off, then find line 90 and carefully change it from

(if (> number 1000000)

to some other larger number such as

(if (> number 2000000)

But this is a risk. Audacity may crash and the text files produced may be too large to open. So don’t say we did not tell you. :wink:


Both, actually. I tried to create a txt file with the sample data in the same folder as the file I had imported into Audacity. (The folder name contained some foreign characters.) So I’m not sure which of the two paths caused the problem. But my guess would be that neither the ‘imported-file’ path nor the ‘sample-data-export’ path can contain foreign characters for the ‘sample data export’ feature to work.

And thanks for the suggestion! I will play around with the number and I won’t blame you if things don’t turn out well haha.

Hi Gale,

I have another question. Is there a way for me to change the sampling rate? I think that would save me the trouble of iteratively sampling and then deleting 22.167 seconds or risking a crash by changing the number in line 90 to 2 million or greater. Thanks in advance!

It’s not only the crash risk. Many programs won’t open text files that are many MB’s in size.

If you reduce the sample rate there will be fewer samples which means you will lose the high frequencies. The song will sound “dull” at sample rates below the default 44100 Hz. If that’s what you want, change the “Project Rate” bottom left to a lower rate then Tracks > Resample.

Wavosaur (not made by us) has a similar data export feature that does not have sample limits that I know of - but once again, if you can’t open the text files it writes it will be a pointless exercise.


Oh I see… Thank you so much for all the help, Gale! I’ll look into the different options and choose whatever works best for me.