Music on Hold with 16kHz Quality

Hello Everyone.

I want to use MoH to play music out loud on a PA system. I’m using arecord to record the input of the line in on the Asterisk Computer, and get it to play out on the PA system. The sound quality is very bad, and I’ve concluded it’s because I cannot sample more than 8kHz since this seems to be the limitation on most codecs. I have found that g722 do have 16kHz sample rate, but my asterisk is forcing it into 8kHz. Have anyone had this issue before? or do someone have a better idea of doing this?

What is doing the D to A conversion? That is likely to limit the codec options.

Also G.722 is a voice codec, so may well be worse for music, at 16kHz, than G.711 (A-Law or mu-law) at 8kHz.

I have a SNOM PA1 box which is receiving the MoH signal, and plays it through a line out on active speakers.
I have tried with G.711 (both), with no better success.
I’ve tested by recording to a file and play out the file through the same type of speakers but with the line out on the computer, and it has bad quality on 8kHz and OK quality at 16kHz, but if I force the 16kHz directly through MoH, it gets distorted, and I can look through the Wireshark stream, that no matter what codec i try to use, Asterisk puts the entire call on 8kHz sample rate.
I can’t be the only one trying to push through music on an Asterisk system, there must be something I’ve missed.

On codecs that support multiple sample rates, you are likely to have to make changes in codecs.conf. Also, the peer has to announce support for the sample rate in its SDP.

With the exception of slin and alin16, all the codecs are optimised for voice (typically they make assumptions about vocal tract resonances). Phones and gateways are unlikely to support slin and slin16.

Limiting to 8kHz should produce a quality similar to AM radio stations, although some AM stations exceed their allocated bandwidth.

An unrelated posting here, so I’ll slap my own hand, but Digium’s phones do support slin and slin16 - not that those codecs should be used outside of testing really.