Ubuntu – How to change audio bit depth and sampling rate

sound

I'm a novice Linux user. I'm currently using Xubuntu 11.10

I like getting the best I can out of my hardware. This includes sound. In windows it was quite simple. I just went to the audio settings and set the bit depth and sampling rate to the biggest values available.

With Xubuntu though, it's a little more tricky. There is no advanced settings in the graphic configurator. That means I have to look for bit depth and sampling rate in a configuration file. The thing is, I don't know which one exactly.

If anyone could tell me which one it is and which lines I have to modify, I would be grateful.

Best Answer

  • To change the sample rate and audio bit depth we need to edit the configuration file for the pulseaudio server /etc/pulse/daemon.conf

    Please backup the original settings to restore the defaults in case som settings break your audio.

    Look for the following entries:

    ; default-sample-format = s16le
    ; default-sample-rate = 44100
    

    Both are commented out with ;. This means they are not read as the entries given here are the defaults. Uncoment them and replace them with values that suit you better. Always keep in mind that this may be on cost of system performance or stability when choosing extreme values.

    Possible entries for the sample format are: u8, s16le, s16be, s24le, s24be, s24-32le, s24-32be, s32le, s32be float32le, float32be, ulaw, alaw

    Possible entries for the sample frequency are anything between 1 and 192000 Hz (choose sensible values!)

    Save this file as ~/.pulse/daemon.conf or in it's original location (you need to be root then). In order for changes to take effect pulseaudio needs to be restarted with pulseaudio -k in a terminal, or by log out and log back in.

  • Related Question