Export to 8-bit CCITT file for Cisco telephony

Continuing the discussion from Need help with G.711 8 khz 8 bit mono u-law wav file:

In Audacity 2.x I was able to export to (G.711) μ-law 8-bit 8kHz CCITT for telephony, but now in 3.3 I am finding that the relevant options, whether I choose WAV (Microsoft) U-law, or “Other uncompressed files” WAV/U-law, or Custom FFmpeg wav/pcm_mulaw, always export a 16-bit file. The FFmpeg options provide a field for bit RATE but not bit DEPTH.

Do I have to downgrade to generate an 8-bit file? Or record my original in 8-bit (yuck!) ?What am I missing?

Interesting. I’m on Audacity 3.2.4 and exporting to WAV (Microsoft) with U-Law encoding gives me 8 bits per sample.

How are you determining that it’s 16 bits? Are you exporting as stereo so that each sample is 8 bits but there are two of them each sample time? u-law can’t be anything other than 8 bits so I’m confused how it could be 16 bits anyway.

Thank you Christop for your patient reply. I did some testing several weeks ago, and then again today, and I guess I got confused, being in a hurry to get a phone prompt out the door for my sysadmin.

I used Audacity 2.x on Windows for years, and now I am back on Mac for the first time in this century, plus the Export dialog in Aud 3 looks a bit different.

So yes, you are right, apparently it was the sample rate and not the bit depth that was blowing up my file size.

I record and do DSP at 32kHz, but I need to deliver the crappy-sounding μ-law file, which needs to be 8kHz.

It now seems that whether I export using File Type: WAV (Microsoft) or Custom FFmpeg, both exports will retain the input sample rate. But it also seems (and this feels new to me) that if I change my
Audio Setup >> Audio Settings >> Project Sample Rate to 8kHz, and THEN do the export, it does not change the playback duration of the source file, but does determine the sample rate of the exported file.

Am I doing this right, or is there a simpler way?

Thanks again!

Yes, I believe that’s correct. You have to set the project sample rate to 8 kHz as you’ve done and then export.

I’ve read on this forum that a future version will give you a chance to set the sample rate in the export dialog, but that may be only for MP3 exports (I haven’t followed the discussion of that feature very closely).

No, that should be for all formats - as all formats are dealt with through the same dialog.

3.4.0 release is in Beta test right now and should hopefully be released soon. This is what the export dialog will look like in 3.4.0:


Aah! Looks like 3.4 puts everything I need into one straightforward dialog: file format, channels, sample rate, (μ-law) encoding. And apparently it makes the metadata dialog a downstream option rather than an interstitial that can be an annoyance if you don’t need it (I use it for mp3, so I haven’t ticked the “do not show” box)

Very intuitive, and eliminates the hidden trap door of needing to record at one sample rate, then remember to change the rate before exporting.
Thank you developers! Can’t wait!

1 Like