Answer the question
In order to leave comments, you need to log in
Is Asterisk converting sox to ogg real?
Good afternoon!
The plan is that you need to convert wav to ogg through AGI, I do this
[asr_menu]
exten => s,1,Answer()
exten => s,n,Wait(1)
exten => s,n,Record(/tmp/${UNIQUEID}.wav,3,20)
exten => s,n,AGI(asr.php,/tmp/${UNIQUEID})
exten => s,n,Set(varasr=${asr})
-- Executing [3@ivr-9:2] Goto("SIP/88005550555-00010a97", "asr_menu,s,1") in new stack
-- Goto (asr_menu,s,1)
-- Executing [[email protected]_menu:1] Answer("SIP/88005550555-00010a97", "") in new stack
-- Executing [[email protected]_menu:2] Wait("SIP/88005550555-00010a97", "1") in new stack
-- Executing [[email protected]_menu:3] Record("SIP/88005550555-00010a97", "/tmp/1617377185.1436643.wav,3,20") in new stack
-- <SIP/88007550775-00010a97> Playing 'beep.ulaw' (language 'ru')
-- PJSIP/805-00046690 answered
Executing [[email protected]_menu:4] AGI("SIP/88005550555-00010a97", "asr.php,/tmp/1617377185.1436643") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/asr.php
-- <SIP/88005550555-00010a97>AGI Script asr.php completed, returning 0
#!/usr/bin/php -q
<?php
require('phpagi.php');
$agi = new AGI();
$audio = $argv[1];
shell_exec('sox '.$audio.'.wav '.$audio.'-conv.ogg -G rate 8000');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question