What wav audio file formats are supported by Asterisk MOH?

Hi,

please tell me, what wav file audio formats are supported by Asterisk MOH ?

I have tried to record a number of test audio files in wav formats to be played as MusicOnHold
and it looks like a number of wav formats, bitrate, frequency is limited .

I am looking for audio recorder supporting Asterisk audio codecs.

Ok. I have listed Asterisk installed audio codecs with
show audio codes command
as
g723, gsm, ulaw, alaw, g726, adpcm, slin, lpc10 g729, speex, ilbc

but need more detailed specification on wav file format to be played by Asterisk.

thanks

Basically the wav files are a mono, 8000Hz sample rate, 64 kbs.

http://wiki.kolmisoft.com/index.php/Convert_WAV_file_to_Asterisk_playable_format

The installed codecs are not so critical as the codecs actually used.

Asterisk can handle MOH files in most of the codec formats, however, I believe the only formats supported with a WAV (RIFF) wrapper are 8 bit, mono, signed linear, 8kHz, and standard rate GSM. For GSM, I believe you have to capitalise the .WAV (and not for signed linear).

Ideally you should create MOH variants for all the codecs that your callers might use. In some cases, it is useful to use G.729 MOH without actually having a G.729 codec installed.

Thanks mazzic,
thanks david55,

I am just trying to resample wav file using Audacity app
Al,l I can set is
rate to 8000 Hz
sample rate to 16 bits or up
mono

What is a relation between sample rate like 16 bits and 64 kbs
as 8000 Hz rate can be adjusted seperately

====
(to Audacity)

Hi,

I was told to record audio stream and save to

wav file mono, 8000Hz, 64 kbs to be played by Asterisk MusicOnHold

"
Basically the wav files are a mono, 8000Hz sample rate, 64 kbs.
"
Does Audacity support this file save format ?

If so, what option should be selected.

==
Having wav file opened with Audacity I can select selecting DTMF0 menu
to get submenu options

Set Rate - set rate to 8000 Hz
Set sample rate - set rate to 16 bit
selected mono

But how to save opened wav file as mono, 8000Hz, 64 kbs on output, not in a viewer ?

Another my question is how to use Audacity audio filters to discover what distortion come with
sound from Asterisk, playing audio files to a sound card via Celliax audio channel .

thanks

==
Darius

You want 8 bit

I would suggest creating a 16 bit, 16kHz file and then using SOX to convert it into one of the formats that Asterisk can convert.

[quote]Another my question is how to use Audacity audio filters to discover what distortion come with
sound from Asterisk, playing audio files to a sound card via Celliax audio channel .[/quote]

That’s quite a technical problem, and I doubt that Audacity is a good tool for it.

Codecs like GSM and G.729 are designed for speech only, so they will not handle music well. The corruption will not, however, be simple harmonic distortion, so I would suggest that you either need deep technical knowledge, or you should compare by ear.

You want 8 bit

I would suggest creating a 16 bit, 16kHz file and then using SOX to convert it into one of the formats that Asterisk can convert.

Thanks David,

as my Audiocity keeps saving wav as 16 bit I used another tool to get mono , 8000 Hz, 6 bit sample.

[quote]Another my question is how to use Audacity audio filters to discover what distortion come with
sound from Asterisk, playing audio files to a sound card via Celliax audio channel .[/quote]

That’s quite a technical problem, and I doubt that Audacity is a good tool for it.

Codecs like GSM and G.729 are designed for speech only, so they will not handle music well. The corruption will not, however, be simple harmonic distortion, so I would suggest that you either need deep technical knowledge, or you should compare by ear.[/quote]

I am looking for Asterisk audio quality testing group, forum, exactly to learn
what professional tools, sample audio files should I use ( audio spectrum analyzer, FFT, echo canceller, adaptive in-line filters) to get sound quality problem fully and in details diagnozed.

There is a class of sample audio files (one frequency files - I suppose) which can be used as
line-in and synchronising in time Asterisk audio input as one source with
original audio sample played by another app, one can learn more about what kind of audio distorsion takes place.

Digital Signal Processing, CD, DVD audio mastering professionals should be of some help.

thanks

Darius

Most audio quality problems are going to be the result of codec choice and packet loss, rather than bugs in Asterisk, especially in a pure VoIP world, or where PSTN interfacing is being done outside of Asterisk.

I would imagine that rather a large amount of work has been done on those areas already, although most of it will be in academic journals for which you will have to pay.

I repeat that the sorts of distortion you get will not be simple. Simply substracting the time domain input from the time domain output may indicate a much greater degree of corruption than really exists, because the codecs will be deliberately discarding information that is not relevant for speech, which may result in phase shifts and whole missing frequency bands.

In common VoIP scenarios, codec issues will be solely the responsibility of the phones. Asterisk and the network will only contribute to packet loss.

If you want the best quality from MOH, you will convert it to the codec used by the phone, offline, so that the runtime CPU load is minimised.

Thanks David,


Most audio quality problems are going to be the result of codec choice and packet loss, rather than bugs in Asterisk, especially in a pure VoIP world, or where PSTN interfacing is being done outside of Asterisk.

You are right but in my case no PSTN interfacng as Asterisk is run on laptop delivering audio via Celliax to a sound card
and Audacity app recorded audio streaming.

I experimented with Audacity to export MOH playable audio file and failed.

Are you aware of audio samples library MOH playable files (mono, 8 bit, 8000 Hz, 64 kbps ) to let
me download and play Atserisk audio quality test MOH samples ?

Windows Media Player.

Windows Sound Recorder.

SOX.

I imagine Audacity will.

Actually, I made a mistake in that Asterisk .wav files are actually 16 bit linear. The reason that 64kbps =8 bit by 8kHz came up is that the PSTN doesn’t use linear coding it uses G.711. Sound recorder can definitely convert to RIFF wrapped G.711. I suspect Audacity can.

[root@centos en]# file you-wish-to-join.wav
you-wish-to-join.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz

However, your quality problems are not due to lossy codecs. They are due to gaps in the data stream.

Also, the PSTN audio quality is quite low and mobile phone audio quality is a lot lower, especially for music. VoIP codecs tend to be either near to PSTN or near to mobile phone quality.

Finally, it may be worth noting that the technical figure of merit for VoIP codecs, standardised by ITU(T) isn’t measured by some complex instrumentation, but by collecting statistics on how people think they sound.

Generally, I think you are out of your depth and you need to understand codecs, sound file formats and psycho-acoustics a lot more.

[quote=“david55”]Windows Media Player.

Windows Sound Recorder.

SOX.

I imagine Audacity will.

Actually, I made a mistake in that Asterisk .wav files are actually 16 bit linear. The reason that 64kbps =8 bit by 8kHz came up is that the PSTN doesn’t use linear coding it uses G.711. Sound recorder can definitely convert to RIFF wrapped G.711. I suspect Audacity can.

[root@centos en]# file you-wish-to-join.wav
you-wish-to-join.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz

However, your quality problems are not due to lossy codecs. They are due to gaps in the data stream.

Also, the PSTN audio quality is quite low and mobile phone audio quality is a lot lower, especially for music. VoIP codecs tend to be either near to PSTN or near to mobile phone quality.

Finally, it may be worth noting that the technical figure of merit for VoIP codecs, standardised by ITU(T) isn’t measured by some complex instrumentation, but by collecting statistics on how people think they sound.

Generally, I think you are out of your depth and you need to understand codecs, sound file formats and psycho-acoustics a lot more.[/quote]

Thanks David,

Asterisk’s MOH playable file is exactly mono, 16bit, 8000 Hz and Audacity supports that export format.
Recorded microphone input with audacity and exported as mono, 16bit, 8000 Hz wav file
and Asterisk can play it as MOH.

So a way to build library of wave, audio samples to test quality of audio played by Asterisk MOH is finally open.

Next step is to have audio stream generated and uploaded to local apache server and have Asterisk to play it
as MOH,
to let me set live wave pattern - sine, square, sawtooth, frequency, amplitude.