Converting Linear PCM 24 bit 48 kHz recordings?

Hello,

I am new to Audacity. I operate on Mac OS 10.8.2 and installed from dmg.

I am doing nature field recordings and will record in Linear PCM 24 bit 48 kHz.Is Audacity capable of converting these files into WAV?

If not, does anyone know of software that is compatible with Mac for doing just this? Then I can import to Audacity for other functions.

Thanks,

Birdscount (Karen)

Linear PCM is a confusing term, usually taken to mean PCM at higher than the 44100 Hz sample rate used in standard WAV and in audio CD’s (despite those can be regarded as LPCM also).

So your files may be WAV already but since WAV and RF64 are container formats they could contain even AC3 or some compressed format.

I suggest you look at the Manual for the recorder. If Audacity does not open the files, try adding FFmpeg to your computer http://manual.audacityteam.org/o/man/faq_installation_and_plug_ins.html#macff .


Gale

test_audio.aiff (357 KB)
test_audio.aiff (357 KB)
OS = Mac 10.7.5, Audacity version is 2.0.5

I am attempting the exact same exercise. I record sound with a board that I built that uses a micro controller, an audio ADC, and flash memory. This data is a stream of PCM 16bit signed, 44.1kHz samples, but could be any variation of standard resolution or sample rate values. (LPCM or Linear PCM only means not compressed in the context that I am familiar with.) Uploading the flash data to the PC could assume formatting the data as 16bit ASCII (text), or hex in two 8bit bytes. I would like to play this “raw” data directly with Audacity. Creating a .wav file is a royal pain and I hope unnecessary. The metadata header format is ugly. See https://ccrma.stanford.edu/courses/422/projects/WaveFormat/

I thought in order to see what an Audacity “raw” input file should look like I would record a snippet of music with Audacity and export it as raw. The closest format I could see in the export pulldown is “AIFF (Apple) signed 16 bit PCM”. The output file is test_audio.aiff which is attached. This file can only be view by a hex editor. I use the tool HexEdit for Mac. This aiff file has lots of header metadata, similar to a .wav file. Not what I want to have to generate, and not what is required for Audacity’s Import RAW data. Raw data should just unformmated PCM.

My next experiment was to export the audio snippit as a .wav file and converter it to “C code” or in the form my circuit would create. This was done with cjseymour’s wav2c.exe on a Windows PC. The result is the attached test_audio.txt which is viewable with a text editor. This ASCII file can can be read by Audacity but provides no sound.

I need explicit byte by byte description of data format for the simplest Audacity importable RAW file.

You seemed to attach the same file twice.

Should this be a separate topic about how to export RAW data?

To export raw data, choose “Other uncompressed files”, click Options… then for header choose “RAW (header-less)” and choose your encoding. See http://manual.audacityteam.org/o/man/file_export_dialog.html . You can then Import Raw to verify what you exported.


Gale

Probably the simplest format is “8 bit signed integer PCM raw”, which is simple a series of 8bit values representing the audio samples. For example, here is an 8 bit signed PCM raw file of a sine wave. If you look at the file in a hex editor you will see a series of 1 byte (8 bit) numbers starting from 00 Hex and rising to 7F Hex (127 decimal), then falling to 80 Hex (-128 decimal) and so on.

The file can also be imported into Audacity using “File > Import > Raw Data” and selecting “Signed 8 bit PCM” as the encoding.

Hi Gale, I think my challenge was the same as the original author, ‘birds count’; I want to create audio stream files with an Analog to Digital Converter and then listen to the binary audio with Audacity.

Steve, you provided the answer. The sinewave file you gave me appeared to have no header information. It would not be usable as WAV file (lacks the WAV metadata header), but is fine for import as RAW. If fact I cut out the top 20 lines or so in a hex editor and it still plays after imported as raw. The file has a .wav extension, but for RAW, the extension can be anything. I changed filename to sinewave.xyz and it still imports and plays the tone. I also exported my short Audacity created audio recording as a WAV file and stripped off the top of the file and it imports and plays as a RAW file.

So now, it seems that I only need to convert my ADC binary data to hex format before uploading to Audacity.

Thanks.

I don’t understand why the file is called “sinewave-raw-8bit-unsigned-pcm.wav” when it is a signed file.

As I understand it, WAV cannot encode signed 8-bit PCM, so it seems a strange choice to record in, as is recording with reduced dynamic range.


Gale

Because I named it incorrectly. The first version that I made was indeed “unsigned integer” but then I changed it to “signed integer” but forgot to change the name. (Romeo and Juliet. Act II. Scene II)

The .WAV extension is just for convenience - the forum does not allow .raw files to be uploaded, but as bamboola correctly deduced, the file extension is irrelevant for RAW data because there is no header, hence no real “file format”, it is just binary data. 8 bit formats are more “simple” than higher bit formats because they avoid issues with endianness.