Asterisk Playback Ogg Files

Home » Asterisk Users » Asterisk Playback Ogg Files
Asterisk Users 3 Comments

hi,

is it possible to playback ogg/opus files to alaw sip clients?

exten => _[*+#0-9].,n,Playback(/var/lib/asterisk/sounds/output.ogg,)

[Dec 22 14:05:53] WARNING[49275][C-00000004]: file.c:789
ast_openstream_full: File /var/lib/asterisk/sounds/output.ogg does not exist in any format
[Dec 22 14:05:53] WARNING[49275][C-00000004]: file.c:1262
ast_streamfile: Unable to open /var/lib/asterisk/sounds/output.ogg
(format (alaw)): No such file or directory
[Dec 22 14:05:53] WARNING[49275][C-00000004]: app_playback.c:497
playback_exec: Playback failed on PJSIP/endpoint33-00000003 for
/var/lib/asterisk/sounds/output.ogg,

dev*CLI> module show like ogg Module Description                              Use Count  Status Support Level format_ogg_opus.so             OGG/Opus audio                          
0          Running core format_ogg_speex.so            OGG/Speex audio                         
0          Running extended

dev*CLI> module show like opus Module Description                              Use Count  Status Support Level codec_opus.so                  OPUS Coder/Decoder                      
0          Running extended format_ogg_opus.so             OGG/Opus audio                          
0          Running core res_format_attr_opus.so        Opus Format Attribute Module            
1          Running              core

core show translation

          ulaw  alaw   gsm  g726 g726aal2 adpcm slin8 slin12 slin16
slin24 slin32 slin44 slin48 slin96 slin192  g729 speex8 speex16 speex32 
ilbc  g722 testlaw  opus
     ulaw     –  9150 15000 15000    15000 15000  9000  17000 17000 
17000  17000  17000  17000  17000   17000 15000  15000 23000   23000
15000 17250   15000 23000
     alaw  9150     – 15000 15000    15000 15000  9000  17000 17000 
17000  17000  17000  17000  17000   17000 15000  15000 23000   23000
15000 17250   15000 23000

audio file created with google TTS

https://cloud.google.com/text-to-speech/docs/reference/rest/v1/text/synthesize

|OGG_OPUS| Opus encoded audio wrapped in an ogg container. The result will be a file which can be played natively on Android, and in browsers
(at least Chrome and Firefox). The quality of the encoding is considerably higher than MP3 while using approximately the same bitrate.

Marek

3 thoughts on - Asterisk Playback Ogg Files

  • modified

    exten => _[*+#0-9].,n,Playback(/var/lib/asterisk/sounds/output.ogg)
    changed to exten => _[*+#0-9].,n,Playback(/var/lib/asterisk/sounds/output-ogg)

    file
    [root@dev cz]# file /var/lib/asterisk/sounds/output-ogg.ogg
    /var/lib/asterisk/sounds/output-ogg.ogg: Ogg data

    [Dec 22 14:39:26] WARNING[50541][C-0000000a]: file.c:789
    ast_openstream_full: File /var/lib/asterisk/sounds/output-ogg does not exist in any format
    [Dec 22 14:39:26] WARNING[50541][C-0000000a]: file.c:1262
    ast_streamfile: Unable to open /var/lib/asterisk/sounds/output-ogg
    (format (alaw)): No such file or directory
    [Dec 22 14:39:26] WARNING[50541][C-0000000a]: app_playback.c:497
    playback_exec: Playback failed on PJSIP/endpoint33-00000009 for
    /var/lib/asterisk/sounds/output-ogg

    Dne 22/12/2021 v 14:54 Doug Lytle napsal(a):

  • If the actual filename is output.ogg then the code should be

    exten => _[*+#0-9].,n,Playback(/var/lib/asterisk/sounds/output)

    You’ll also need to confirm that you compiled Asterisk with Vorbis support.

    Doug