Import data that was exported by "Sample Data Export"

Hello everyone,

I am new to this forum but I’d like to start right off with a question. As I’m working on a program that analyses Sound, separates it into single harmonic oscillations and puts it back together I want to export a sound clip recorded with Audacity, analyse it and get it back into Audacity so I am able to listen to it and “proof” whether it worked.

Now my problem is that I am not able to import Data in the format “txt” in the “correct way”,
although it has the same structure as the exported Sample:

  • Measurement Scale : Linear
  • File data format: Sample List (txt)
  • Include header information: None
  • Channel layout for Stereo: L Channel First (I don’t actually use stereo)

Does anyone know, which kind of “raw data” I need to import, so that it works? I worked on that for a couple of days now without finding an answer.

Adrian

Ps: Please excuse any mistakes, I’m not English :slight_smile:

It won’t work with “Import Raw”.

“Raw” data is simply a sequence of binary numbers - digital “1’s” and digital “0’s”.
A “text” file is different, even if it represents the same data.

In a text file, words and numbers are represented as typographic characters. In order to get that data into Audacity and “convert” it into sound, it is necessary to use a program that can “read” the text, line by line, and create audio data according to the “instructions” in the text.

Writing a very basic program to do this will not be very difficult provided that you only want to “convert” very small amounts of data (not more than a few thousand lines). If you are wanting to convert long sections of audio (millions of lines or more) or if you want a “proper” program with a nice user interface and suchlike, then it becomes a much bigger and more difficult task.

So,… tell us a bit more about what you want to do. In particular, how many lines of text need to be read, and why are you not doing the entire task in Audacity rather than exporting text and importing it again? I’m not sure exactlt what “the task” is, but it sounds interesting, so please do describe in full.

I sounds like you shouldn’t be using text data. Once you re-assmemble the data into PCM format, there are libraries for making a WAV file, complete with a header. (I’ve done some programming but never any audio programming, so I can’t help with the details).

As I’m working on a program that analyses Sound, separates it into single harmonic oscillations and puts it back together

It sounds like you are trying to re-invent the [u]Fourier Transform[/u] (and the Reverse Fourier Transform). Again, there are libraries for that, or you can use a tool like Matlab (or one of the free Matlab clones).

There are some common things that are done with FFT/DFT, such as changing speed without changing pitch. Spectrum analyzers generally use FFT (displaying the results graphically without doing the reverse FFT.)

Also see https://forum.audacityteam.org/t/importing-text-as-audio-exporting-audio-as-text/21905/14 .

Gale