What Microsoft PCM ? Diff with PCMA or PCMU?

Hello,
I’m discovering SIPp rt_stream capability which now accepts PCMA formatted audio files.
Asterisk can produce .wav files.
With one of these, I’v got:
file /tmp/tt-monkeys.wav
/tmp/tt-monkeys.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz

What does “Microsoft PCM” in this context ?
What is the difference with PCMA or PCMU ?

Regards

A-Law and µ-law are 8 bit companded formats - they are non-linear in order to encode a wide dynamic range into a small number of bits. The file you are referencing is 16 bit signed linear.

I guess Microsoft just refers to the fact that Microsoft call it PCM. (PCM is pulse code modulation.)

There is a many to 1 mapping between the .wav format above and both A-law and µ-law, so there is no data loss going from A-law, etc. to 16 bit but there is data loss going the other way. Asterisk uses 16 bit linear as a basis, because most other formats, at the same sample rate, can be converted to it without loss.

Asterisk doesn’t analyze the metadata in .wav files, and just looks at the capitalisation of the extension, to decide between two formats.

.wav can wrap A and µ-law formats, but Asterisk will not recognize them. Asterisk can save A-law and µ-law, but they have no metadata, so file will treat them as data.

$ file *.wav file.*; ls -l *.wav file.*
alaw.wav:  RIFF (little-endian) data, WAVE audio, ITU G.711 A-law, mono 8000 Hz
mspcm.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz
ulaw.wav:  RIFF (little-endian) data, WAVE audio, ITU G.711 mu-law, mono 8000 Hz
file.alaw: data
file.ulaw: data
-rw-r--r-- 1 david david 240170 Feb 23 15:22 alaw.wav
-rw-r--r-- 1 david david 240000 Feb 23 16:03 file.alaw
-rw-r--r-- 1 david david 240000 Feb 23 16:04 file.ulaw
-rw-r--r-- 1 david david 480156 Feb 23 15:32 mspcm.wav
-rw-r--r-- 1 david david 240170 Feb 23 15:21 ulaw.wav

Incidentally, Audacity, describes the 16 bit linear format as “signed 16 bit PCM” without mentioning Microsoft (from the export as WAV page).

image

Thank you all, for responding !

Using sow (wit -e a-law arg), I could convert existing GSM or Microsoft PCM files to :slight_smile: ```
alaw.wav: RIFF (little-endian) data, WAVE audio, ITU G.711 A-law, mono 8000 Hz

These ITU G.711 A-law WAV files can read by SIPp in rtp_stream statements.
Thanks again.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.