ChanSpy Recording Format

Does anyone know how I can specify the recording format for chanspy recordings? Asterisk is recording the call is some headerless raw format thats proving difficult to convert to a wav.

Currently doing:


It will either by the actual format on the monitoring channel, or 16 bit, 8kHz, signed, linear, mono.

If the latter, converting it with sox should be easy.

You would think but:

sox -c 1 -v 0.7 -r 8000 -t raw test.raw -b 16 -t wav -r 8000 test.wav
sox FAIL formats: bad input format for file `test.raw': data encoding or sample size was not specified

sox -c 1 -v 0.7 -r 8000 -t wav test.raw -b 16 -t wav -r 8000 test.wav
sox FAIL formats: can't open input file `test.raw': WAVE: RIFF header not found

Oddly if I just do a RECORD FILE on the channel it records to a standard 16bit 8KHz wav, its only the chanspy recording that has an odd format.

You haven’t fully characterised the input format. As there is no meta data, the only reason for sox complaining is that it hasn’t been given enough information. As the message hints, you are missing both data encoding and sample size, on the other hand, the volume adjustment should not normally be needed.

I dont know the format. Thats part of the problem.

Alright, I figured it out, sheesh :slight_smile:

sox -c 1 -r 8000 -b 16 -e signed-integer IN.raw -b 16 -t wav -r 8000 OUT.wav