Review Board 1.7.16


wideband streaming with res_musiconhold

Review Request #3112 - Created Jan. 9, 2014 and submitted

wdoekes
trunk
Reviewers
asterisk-dev
Asterisk
When streaming mp3s or using a custom musiconhold app, selecting format=sln16 wasn't possible. The audio would become choppy and unbearable.

The cause is that the reader only feeds 8kHz of info to asterisk per second, while we require 16kHz.
The basic class->format calculation worked on Asterisk 11 with the following scenario. I added a bit of documentation and it still compiles.


[default]
mode=custom
;application=/etc/asterisk/musiconhold.sh 8000
;format=slin
application=/etc/asterisk/musiconhold.sh 16000
format=slin16


#!/bin/sh
hz="$1"
test -z "$hz" && hz=8000
mp3toraw="/usr/bin/madplay -Q -o raw:- --mono -b 16 -R $hz -a -12 -"
cat my_audio_file.mp3 | $mp3toraw
Review request changed
Updated (Jan. 20, 2014, 8:57 a.m.)
  • changed from pending to submitted

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.