mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Updated code for v1p1beta1 API utilization
Advanced --> Default Settings --> Voicemail. Add: Category: voicemail Subcategory: transcribe_provider Type: text Value: google Enabled: true Add: Category: voicemail Subcategory: transcribe_enabled Type: boolean Value: true Enabled: true Add: Category: voicemail Subcategory: json_enabled Type: boolean Value: true Enabled: true Add: Category: voicemail Subcategory: transcribe_enabled Type: boolean Value: true Enabled: true Add: Category: voicemail Subcategory: json_enabled Type: boolean Value: true Enabled: true Add: Category: voicemail Subcategory: google_key Type: text Value: INSERT YOUR API KEY HERE Enabled: true Add: Category: voicemail Subcategory: google_url Type: text Value: https://speech.googleapis.com/v1p1beta1/speech Enabled: true
This commit is contained in:
@@ -282,7 +282,7 @@
|
||||
local api_key = settings:get('voicemail', 'google_key', 'text') or '';
|
||||
local transcription_server = settings:get('voicemail', 'google_url', 'text') or '';
|
||||
if (api_key ~= '') then
|
||||
transcribe_cmd = [[sox ]]..file_path..[[ ]]..file_path..[[.flac && echo "{ 'config': { 'languageCode': 'en-US', 'enableWordTimeOffsets': false }, 'audio': { 'content': '`base64 -w 0 ]]..file_path..[[.flac`' } }" | curl -X POST -H "Content-Type: application/json" -d @- "]]..transcription_server..[[:recognize?key=]]..api_key..[[" && rm -f ]]..file_path..[[.flac]]
|
||||
transcribe_cmd = [[sox ]]..file_path..[[ ]]..file_path..[[.flac trim 0 00:59 && echo "{ 'config': { 'languageCode': 'en-US', 'enableWordTimeOffsets': false , 'enableAutomaticPunctuation': true , 'alternativeLanguageCodes': 'es' }, 'audio': { 'content': '`base64 -w 0 ]]..file_path..[[.flac`' } }" | curl -X POST -H "Content-Type: application/json" -d @- "]]..transcription_server..[[:recognize?key=]]..api_key..[[" && rm -f ]]..file_path..[[.flac]]
|
||||
end
|
||||
|
||||
local handle = io.popen(transcribe_cmd);
|
||||
|
||||
Reference in New Issue
Block a user