Music on hold interrupts with continuous noise

General discussions about Asterisk.

Moderators: Moderator, Support

Music on hold interrupts with continuous noise

Postby yurybx » Mon Dec 14, 2015 12:18 pm

We have a branded music and try to use it as music on hold in asterisk. But while playing music, it interrupts with a loud noise. Codec used is alaw. The formats for moh file I tried are wav, ulaw, alaw and GSM (I have converted the music into alaw and ulaw with sox utility). Only GSM plays normally, but it's quality is too low. I have tried to decreace volume by 12 Db, but without result. Obviously, the reason is specific sounds located in our branded music (we had the same problem when tried to make music on hold in Panasonic PBX). The sounds seems to be hard to encode with VoIP formats. But there must be a method to convert music into VoIP oriented sound without using GSM with so lossy quality. Does anybody know such method?
yurybx
Newsterisk
 
Posts: 5
Joined: Mon Dec 14, 2015 11:33 am

Re: Music on hold interrupts with continuous noise

Postby david55 » Mon Dec 14, 2015 4:46 pm

SOX will convert music into low bit rate formats.

The only thing I can think of is that the sound has a lot of energy above 4kHz and there isn't enough anti-aliasing being done in the conversion tool.

I would suggest using the rate operation in SOX explicitly, with a rate of 8000. Given that telephone audio only goes to about 3.4kHz, I'd suggest that you try bandwidths of 85% and 90%, although you might want to play with the other options, as well.

As a lot of people use mobile phones these days, you might want to consider choosing music that tolerates vocoder codecs better, although that may be difficult. It certainly sounds as though your music was not designed to render well in telephone bandwidths.

Note, this is support question, so should have been on Asterisk Support.
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: Music on hold interrupts with continuous noise

Postby yurybx » Fri Dec 18, 2015 6:16 am

Thank you for answer. I use a pcm wav file with 8KHz sampling frequency as source for MOH. So it cannot have a frequencies above 4KHz. I thought that maybe it has ones at ~4Khz which are hard to render. So I edited the file and cut hi frequency. But it had no results. It's strange.
yurybx
Newsterisk
 
Posts: 5
Joined: Mon Dec 14, 2015 11:33 am

Re: Music on hold interrupts with continuous noise

Postby david55 » Sat Dec 19, 2015 4:18 am

I can't really help then. At the least one would need to hear the distortion and a clean verision, to try and understand what was going on at a technical level.

Just a reminder though, Asterisk only accepts two .wav formats natively. .wav is 8kHz, 16 bit,, signed, linear, mono, and .WAV is GSM encoded. Most other formats are bare media, with no meta data.
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: Music on hold interrupts with continuous noise

Postby rootmedia » Mon Dec 21, 2015 10:18 am

make sure your PCM Wave at 8k is also MONO not stereo
Brent HIggs
CEO & Founder at
Image
https://root.media
rootmedia
Newsterisk
 
Posts: 9
Joined: Thu Dec 17, 2015 12:57 am
Location: Vancouver, BC

Re: Music on hold interrupts with continuous noise

Postby lardconcepts » Mon Dec 21, 2015 4:42 pm

This works for me when converting audio/music to alaw:

Code: Select all
find . -name '*.mp3' -type f -print0 | xargs -0 -t -r -I {} sox {} -r 8000 -c1 -e a-law {}.al lowpass 4000 compand 0.02,0.05 -60,-60,-30,-10,-20,-8,-5,-8,-2,-8 -8 -7 0.05


Then to tidy the filenames if you want to:

Code: Select all
rename -f 's/.mp3.al$/.al/' ./**/*.mp3.al


Let me know if that works for you!
lardconcepts
Newsterisk
 
Posts: 35
Joined: Tue Nov 11, 2014 2:13 pm

Re: Music on hold interrupts with continuous noise

Postby david55 » Tue Dec 22, 2015 2:18 am

sox should automatically apply an anti-aliasing filter when you do a rate conversion, but, if you are going to use an explicit filter, I would think you would want it rather more than 6dB down a the Nyquist frequency. You only need to pass up to 3400Hz, although you probably want the 6dB point to higher than that.

Companding should only be necessary for wide dynamic range, classical, music.
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: Music on hold interrupts with continuous noise

Postby lardconcepts » Wed Dec 23, 2015 4:05 am

david55 wrote:I would think you would want it rather more than 6dB down a the Nyquist frequency.


David, I am so glad you saw this post! Finally someone you might know how compand works! I understand the basics of compression (as in, audio, not file), normalization, db, frequency, bandwidth, clipping, high and low-pass and so on, and I can quite happily produce reasonable sounding audio in Audacity using the plugins.

But I have to admit at being totally lost with the sox compand argument

Code: Select all
compand attack1,decay1{,attack2,decay2}[soft-knee-dB:]in-dB1[,out-dB1]{,in-dB2,out-dB2}[gain [initial-volume-dB [delay]]]


Yup, I read the sox docs - "Compand (compress or expand) the dynamic range of the audio".

But after that, I'm afraid I am lost - I read things like this below, and I just glaze. I don't consider myself terminally moronic, but....

The second parameter is a list of points on the compander’s transfer function specified in dB relative to the maximum possible signal amplitude. The input values must be in a strictly increasing order but the transfer function does not have to be monotonically rising.


Nope! But all of that said, I have found various compand examples, and this sounds by far the best. The thing is, I've tried low and highpass filters to reflect exactly the G711 alaw range, and they sounded far "thinner" on the phone. While it does occasionally warn of a few sample clips, the string above gives a sound almost identical in quality to, say, the extra-sounds moh and speech included with Asterisk.

But if anyone knows a way of making something in a GUI like Audacity for example, and then exporting the arguments as something that can be used in sox, I'm all ears, so to speak!
lardconcepts
Newsterisk
 
Posts: 35
Joined: Tue Nov 11, 2014 2:13 pm

Re: Music on hold interrupts with continuous noise

Postby david55 » Wed Dec 23, 2015 7:43 am

I haven't used compand in sox, but as examples of the basic principle, and assuming that broadcasters in your country do the same as in the UK. I'll also use the term dynamic range reduction, which I think is more accurate.

Commercial breaks on TV sound louder than the programmes, not because they have a greater maximum loudness, but because their dynamic range has been reduced to make the difference between the soft and loud sounds less.

Analogue TV sound will probably have more dynamic range compression than digital.

Classical music sent over AM radio will usually have its dynamic range greatly reduced, but over FM or digital you are likely to get closer to the full dynamic range.

Most modern pop music doesn't have a lot of dynamic range to start with, but may have it deliberately reduced, to make it sound louder.

G.711 has companding in a more general sense, but that is undone at the receiving end.
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: Music on hold interrupts with continuous noise

Postby yurybx » Thu Jan 28, 2016 1:15 am

Sorry for so late response.
I installed Asterisk 13 in order to get ARI functional. And I was glad to hear our branded music in wav format without any noises! So my problem was solved by itself.
Than you for your replies!
yurybx
Newsterisk
 
Posts: 5
Joined: Mon Dec 14, 2015 11:33 am


Return to Asterisk General

Who is online

Users browsing this forum: No registered users and 12 guests