buggy Import RAW Data

Audacity 2.1.3
Ubuntu 16.04 amd64

This also affects windows version.

Importing 16bit signed raw results strange waveform, seems like non linear a-law or u-law. Also most of the raw formats imports result unexpectedly.
Screenshot_2017-04-28_20-38-08.png
attachments:
sin.raw: a signed 16-bit big-endian linear sine wave

unable to upload raw file, using this xxd dump instead
sin.txt (83 KB)

Note that Audacity attempts to guess the raw data format, but it’s no more than an educated guess. It is not possible to make this guess 100% accurate, which is why audio files usually contain header information.

Please test importing this file as RAW data (you can change the file extension if you wish - I’ve just named it as a WAV file so that I can upload it to the forum).

The settings should be like this (these are automatically selected on my Xubuntu 16.04 machine):
fullwindow-Import Raw Data-000.png
And this is the (correct) waveform as it appears on my machine after importing as RAW:
firsttrack000.png

Not surprising, because “sin.txt” is not 16-bit signed PCM.
Where did that file come from?

Here’s the first 100 bytes as signed 16-bit big endian:
(it does not look like a sine wave to me)

0   30 30  12336
2   30 30  12336
4   30 30  12336
6   30 30  12336
8   3A 20  14880
10  65 36  25910
12  30 30  12336
14  20 65  8293
16  39 30  14640
18  30 20  12320
20  65 39  25913
22  30 30  12336
24  20 65  8293
26  62 30  25136
28  30 20  12320
30  65 65  25957
32  30 30  12336
34  20 65  8293
36  66 30  26160
38  30 20  12320
40  66 30  26160
42  30 30  12336
44  20 66  8294
46  33 30  13104
48  30 20  12320
50  20 2E  8238

i cannot upload the raw, the txt is its xxd dump

you can "xxd -r " to restore the raw.

the correct waveform is like this (using matplotlib)
Screenshot_2017-04-29_17-27-01.png

Thanks! That explains it.

But this is exactly the issue. we need the “Import RAW Data” for raw files have no valid headers. or we can just “open” them.

the attachment is my RAW, extracted from an oscilloscope.

Sometimes I use audacity as a scientific tool, viewing and processing waveform.

On my machine, that is detected by Audacity as signed 8-bit, little endian, 2 channel (stereo), which produces this waveform:

so sad, I wrote a small tool converts the raw to wav…