Fix voicemail greetings file extension
Steps to reproduce the issue current greeting is a wav file. The text-to-speech provider used mp3. Then it would change the file type to mp3. Moved the $speech->get_format(); to the section of code that generates the text-to-speech. So that it doesn't overwrite the file type when its not the text to speech is not being used.
This commit is contained in:
@@ -60,7 +60,6 @@
|
|||||||
if (class_exists('speech') && $speech_enabled && !empty($speech_engine)) {
|
if (class_exists('speech') && $speech_enabled && !empty($speech_engine)) {
|
||||||
$speech = new speech($settings);
|
$speech = new speech($settings);
|
||||||
$voices = $speech->get_voices();
|
$voices = $speech->get_voices();
|
||||||
$greeting_format = $speech->get_format();
|
|
||||||
//$speech_models = $speech->get_models();
|
//$speech_models = $speech->get_models();
|
||||||
//$translate_enabled = $speech->get_translate_enabled();
|
//$translate_enabled = $speech->get_translate_enabled();
|
||||||
//$language_enabled = $speech->get_language_enabled();
|
//$language_enabled = $speech->get_language_enabled();
|
||||||
@@ -179,7 +178,8 @@ if (!empty($_POST) && empty($_POST["persistformvar"])) {
|
|||||||
$greeting_path = $settings->get('switch', 'voicemail').'/default/'.$_SESSION['domain_name'].'/'.$voicemail_id;
|
$greeting_path = $settings->get('switch', 'voicemail').'/default/'.$_SESSION['domain_name'].'/'.$voicemail_id;
|
||||||
|
|
||||||
//set the recording format
|
//set the recording format
|
||||||
$greeting_files = glob($greeting_path.'/greeting_'.$greeting_id.'.*');
|
$greeting_files = glob($greeting_path.'/greeting_*');
|
||||||
|
|
||||||
if (empty($greeting_format) && !empty($greeting_files)) {
|
if (empty($greeting_format) && !empty($greeting_files)) {
|
||||||
$greeting_format = pathinfo($greeting_files[0], PATHINFO_EXTENSION);
|
$greeting_format = pathinfo($greeting_files[0], PATHINFO_EXTENSION);
|
||||||
} else {
|
} else {
|
||||||
@@ -197,7 +197,7 @@ if (!empty($_POST) && empty($_POST["persistformvar"])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($greeting_id)) {
|
if (isset($greeting_id) && is_numeric($greeting_id)) {
|
||||||
//set file name
|
//set file name
|
||||||
$greeting_filename = 'greeting_'.$greeting_id.'.'.$greeting_format;
|
$greeting_filename = 'greeting_'.$greeting_id.'.'.$greeting_format;
|
||||||
|
|
||||||
@@ -214,6 +214,12 @@ if (!empty($_POST) && empty($_POST["persistformvar"])) {
|
|||||||
|
|
||||||
//text to audio - make a new audio file from the message
|
//text to audio - make a new audio file from the message
|
||||||
if ($update_greeting && $speech_enabled && !empty($greeting_voice) && !empty($greeting_message)) {
|
if ($update_greeting && $speech_enabled && !empty($greeting_voice) && !empty($greeting_message)) {
|
||||||
|
//set the greeting file format
|
||||||
|
$greeting_format = $speech->get_format();
|
||||||
|
|
||||||
|
//set file name
|
||||||
|
$greeting_filename = 'greeting_'.$greeting_id.'.'.$greeting_format;
|
||||||
|
|
||||||
$speech->audio_path = $greeting_path;
|
$speech->audio_path = $greeting_path;
|
||||||
$speech->audio_filename = $greeting_filename;
|
$speech->audio_filename = $greeting_filename;
|
||||||
$speech->audio_format = $greeting_format;
|
$speech->audio_format = $greeting_format;
|
||||||
|
|||||||
Reference in New Issue
Block a user