Raw audio is rarely written for its own sake. It is the sample data of another format with the header cut off, the output of a recorder or radio, or a dump from a program or a machine. This page lists the sources and the settings that read them. Items marked checked were tested in the explorer’s tests or against FFmpeg; the others follow the documentation named.
The sample data of other formats
| Source | Samples | Rate and channels come from |
|---|---|---|
WAVE data chunk (WAV) | the format code in the fmt chunk: 8-bit unsigned, 16, 24, 32-bit signed little-endian, 32/64-bit float, A-law, µ-law, ADPCM; the canonical header is 44 bytes, so Skip 44 (checked) | the fmt chunk |
AIFF SSND chunk (AIFF) | big-endian signed 8, 16, 24, 32-bit; after the chunk’s 8-byte offset and block size fields | the COMM chunk |
| Sun/NeXT AU (AU) | big-endian; encoding codes include µ-law, A-law, 8, 16, 24, 32-bit signed and floats; data starts at the header’s offset (24 or more) | the header |
IFF 8SVX BODY chunk (8SVX), Amiga | 8-bit signed, mono, unless the Voice8Header says compression 1 (Fibonacci-delta) or 2 (exponential-delta); then 4-bit codes. Skip to the start of the BODY’s data (checked with the delta formats) | the Voice8Header’s samplesPerSec, and its octave count for several octaves in one BODY |
| Creative Voice File sound-data blocks (VOC) | block type 1: unsigned 8-bit after a 2-byte start (time constant and codec); block type 9: the codec, bits and channels are in the block. Codec 0 is unsigned 8-bit PCM; 4 is signed 16-bit little-endian; 6 is A-law and 7 µ-law | type 1: 1,000,000 ÷ (256 − time constant); type 9: a 32-bit rate |
| CAF and W64 audio data (CAF, W64) | as their description chunks say; both can carry either byte order | the description chunks |
| Tracker module samples (MOD and others) | 8-bit signed in MOD; XM stores 8 or 16-bit samples as differences from the last one (Format DPCM, byte or word deltas, little-endian); S3M and IT have flags for 8 or 16-bit and signed or unsigned | the note being played: no fixed rate |
Telephony
- G.711 µ-law (
.ul,.ulaw,.mulaw) or A-law (.al,.alaw) at 8,000 Hz, one byte a sample, one channel: Format µ-law or A-law, rate 8,000 Hz (checked against FFmpeg). - Asterisk
.sln: “signed linear”, 16-bit little-endian, 8,000 Hz; FFmpeg reads it as theslnformat..sln16and.sln48are the same at 16,000 and 48,000 Hz (the explorer does not open.slnfiles as audio, because Visual Studio uses that extension; use Read as to choose Raw PCM audio). - Dialogic
.vox: OKI ADPCM, 4 bits a sample, 6,000 or 8,000 Hz (checked against FFmpeg’sadpcm_ima_oki). - Call recorders and SIP tools often write the audio of one direction as one such file and the other direction as a second file; the two together are the two channels of a stereo recording.
Games and consoles
Dumps of sound memory and extracted samples are the other rich source of raw files. The usual forms, from the machines’ documentation (not checked on real files here):
| Machine | Usual raw form |
|---|---|
| Sega Mega Drive / Genesis (YM2612 DAC samples) | 8-bit unsigned, mono, at a rate set by the sound driver |
| Sega CD / Mega CD (RF5C164) | 8-bit sign and magnitude (use Sign: sign and magnitude) |
| Sega Saturn (SCSP) | 16-bit signed big-endian, or 8-bit signed |
| Sony PlayStation (SPU) | 4-bit ADPCM in 16-byte blocks of 28 samples, not offered as a raw reading; once decoded, 16-bit signed little-endian at up to 44,100 Hz |
| Nintendo 64 | 16-bit signed big-endian, often 32,000 Hz; its VADPCM is not offered as a raw reading |
| Game Boy Advance direct sound | 8-bit signed, mono |
| Archimedes (Acorn) | VIDC logarithmic, 8-bit (checked against FFmpeg’s vidc); the 8 bits are the µ-law magnitude with the sign in bit 0 |
Radio recordings: I/Q pairs
A software-defined radio samples the antenna signal as two numbers per sample: I (in-phase) and Q (quadrature). A recording is a file of I, Q, I, Q … pairs: a stereo file whose two “channels” are one complex signal. In the explorer, set Signal to Radio I/Q pairs (or open a file with one of these extensions): the waveform shows I and Q, the spectrogram uses both parts so negative frequencies appear below the middle and positive above, and a second waveform plays the signal demodulated as AM (the magnitude) or FM (the change of phase), averaged down to about 48 kHz. A made-up AM carrier at +0.2 of the sample rate shows as a bright line at +0.2 of the spectrogram’s height above the middle (checked).
| Extension | Samples | Made by |
|---|---|---|
.cu8 | unsigned 8-bit I, Q | RTL-SDR (rtl_sdr writes this form whatever the name; 2,048,000 Hz is its default rate) |
.cs8 | signed 8-bit I, Q | HackRF (hackrf_transfer) |
.cs16 | signed 16-bit little-endian I, Q | several recorders and converters |
.cf32, .fc32, .cfile | 32-bit float little-endian I, Q (“complex float”) | GNU Radio’s File Sink with a complex float input; also SoapySDR tools |
.cf64 | 64-bit float I, Q | some analysis tools |
.iq, .sdr | no fixed form: the name does not say, so only the Signal is set and the format is left to be chosen or detected | various |
No header says the sample rate or the centre frequency; they are in the name, a sidecar file or the notes of the
person who recorded. The explorer reads a rate from names like capture_2400k.cu8
or fm_2.048msps.iq (checked), and its presets include 250,000, 1,024,000,
2,048,000, 2,400,000 and 3,200,000 Hz.
Tools that write and read raw audio
| Tool | Raw settings |
|---|---|
| FFmpeg | -f s16le (and u8, s24be, f32le, alaw, mulaw, vidc …), -ar for the rate and -ac for the channels, defaulting to 44,100 Hz mono (checked). More under Conversion commands. |
| SoX | file types raw, s16 and so on with -r rate, -c channels, -b bits and -e encoding; the extensions .sw .uw .sb .ub .ul .al .sl name the type, which is where the explorer’s extension list comes from |
| Audacity | File, Import, Raw Data: Encoding, Byte order, Channels, Start offset (bytes), Amount to import (%) and Sample rate: the same questions as the explorer’s options bar |
| libsndfile | a raw file is opened by giving the format SF_FORMAT_RAW with a sub-format, rate and channels |
| NumPy | numpy.fromfile(path, dtype='<i2') reads 16-bit little-endian; the dtype strings < and > are the byte order |
| Web Audio / audio worklets, speech APIs | raw 16-bit little-endian or 32-bit float PCM at 16,000 or 48,000 Hz, mono, is the usual hand-over form (the file speech-model-check.pcm, found in a speech application on this Mac, is 16-bit signed little-endian mono; the explorer detects it first) |