TT#185000 increase sound/voicemails sample rate to 16k

* sample rate was downscaled to 8k by sox for all sound files,
  it's now set to 16k for better audio quality

Change-Id: I7447e08ed90147ec98e110419cc4c068b8299848
mr11.0
Kirill Solomko 3 years ago
parent be402b13a2
commit 7f59aedb4c

@ -20,26 +20,26 @@ sub transcode_file {
SWITCH: for ($target_codec) { SWITCH: for ($target_codec) {
/^PCMA$/ && do { /^PCMA$/ && do {
@conv_args = ($tmpfile, qw/--type raw --bits 8 --channels 1 -e a-law - rate 8k/); @conv_args = ($tmpfile, qw/--type raw --bits 16 --channels 1 -e a-law - rate 16k/);
last SWITCH; last SWITCH;
}; };
/^WAV$/ && do { /^WAV$/ && do {
if ($source_codec eq 'PCMA') { if ($source_codec eq 'PCMA') {
# this can actually only come from inside # this can actually only come from inside
# certain files will be stored as PCMA (for handles with name "music_on_hold") # certain files will be stored as PCMA (for handles with name "music_on_hold")
@conv_args = ( qw/-A --rate 8k --channels 1 --type raw/, $tmpfile, "--type", "wav", "-"); @conv_args = ( qw/-A --rate 16k --channels 1 --type raw/, $tmpfile, "--type", "wav", "-");
} }
else { else {
@conv_args = ($tmpfile, qw/--type wav --bits 16 - rate 8k/); @conv_args = ($tmpfile, qw/--type wav --bits 16 - rate 16k/);
} }
last SWITCH; last SWITCH;
}; };
/^MP3$/ && do { /^MP3$/ && do {
@conv_args = ($tmpfile, qw/--type mp3 --bits 16 - rate 8k/); @conv_args = ($tmpfile, qw/--type mp3 --bits 16 - rate 16k/);
last SWITCH; last SWITCH;
}; };
/^OGG$/ && do { /^OGG$/ && do {
@conv_args = ($tmpfile, qw/--type ogg --bits 16 - rate 8k/); @conv_args = ($tmpfile, qw/--type ogg --bits 16 - rate 16k/);
last SWITCH; last SWITCH;
}; };
# default # default

@ -2377,7 +2377,7 @@ sub convert_voicemailgreeting{
# die('Wrong mime-type '.$mime_type.' for the voicemail greeting. Must be a audio file in the "wav" format'); # die('Wrong mime-type '.$mime_type.' for the voicemail greeting. Must be a audio file in the "wav" format');
# return; # return;
#} #}
my @cmd = ( $filepath, '-e', 'gsm', '-b', '16', '-r', '8000', '-c', '1', $filepath_converted); my @cmd = ( $filepath, '-e', 'gsm', '-b', '16', '-r', '16000', '-c', '1', $filepath_converted);
my $output = ''; my $output = '';
$c->log->debug("cmd=".join(" ", 'sox', @cmd)); $c->log->debug("cmd=".join(" ", 'sox', @cmd));
eval { eval {

Loading…
Cancel
Save