So, when I open this stream, I decoded the RTP packets, and save the raw payload into a file all works fine, and the format is coming across as ulaw.
So all good there!
Now, I imported the raw dump into audacity to test the steam (File → Import → Raw). Which worked … But, it is importing at a sample rate of 32Khz, although I was expecting it to be 8Khz (or 8000 sample rate)
Is there a setting or a configuration where I can set this to be 8Khz or something similar or do I have to use another codex?
Why are you installing FreePBX then bypassing it by using ARI?
Raw files contain no metadata, so the sample rate assumed by Audacity will be arbitrary. You will need to set it explicitly, in Audacity, or use sox to add metadata.
Did you actually tell Audacity that it was µ-law, as µ-law is only really defined at 8kHz.
FreePBX was just a one click install with digital ocean, so it got it installed quickly. No other reason.
Yes, in the API I call format=ulaw.
In Audacity, because I am importing it as a raw format, I have to explicitly set the KHZ and ulaw, so this is why I am confused it was 32KHZ, but yeah ulaw should only be 8Khz.