Playing opus sound files

I have a web developer working recording sound files. I was sent over three files that have the .wav extension. From what I recall Asterisk requires that the sound extension be in the format of the file. For instance if a file is 8khz then the extensions should be .wav but if it’s 16khz then the file should be saved with the extension .wav16. I have built Asterisk 20.0.2 and I believe I have Opus support

poc-of-new-ivr-system*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
3 modules loaded
poc-of-new-ivr-system*CLI> 

I have three test files and what mediainfo is showing the codec as. Is there any extension that I need to change them to for Asterisk to be able to play them or do they need to be down sampled?

[root@poc-of-new-ivr-system sounds]# mediainfo chrome_android.wav
General
Complete name : chrome_android.wav
Format : WebM
Format version : Version 4
File size : 37.1 KiB
Writing application : Chrome
Writing library : Chrome
IsTruncated : Yes
FileExtension_Invalid : webm

Audio
ID : 1
Format : Opus
Codec ID : A_OPUS
Channel(s) : 1 channel
Channel layout : C
Sampling rate : 48.0 kHz
Bit depth : 32 bits
Compression mode : Lossy
Language : English
Default : Yes
Forced : No

[root@poc-of-new-ivr-system sounds]# mediainfo chrome.wav
General
Complete name : chrome.wav
Format : WebM
Format version : Version 4
File size : 50.8 KiB
Writing application : Chrome
Writing library : Chrome
IsTruncated : Yes
FileExtension_Invalid : webm

Audio
ID : 1
Format : Opus
Codec ID : A_OPUS
Channel(s) : 1 channel
Channel layout : C
Sampling rate : 48.0 kHz
Bit depth : 32 bits
Compression mode : Lossy
Language : English
Default : Yes
Forced : No

[root@poc-of-new-ivr-system sounds]# mediainfo firefox_android.wav
General
Complete name : firefox_android.wav
Format : Ogg
File size : 92.8 KiB
Duration : 5 s 860 ms
Overall bit rate : 130 kb/s
Writing application : Mozilla107.0.1
FileExtension_Invalid : oga ogg ogm ogv ogx opus spx

Audio
ID : 1749124805 (0x684186C5)
Format : Opus
Duration : 5 s 860 ms
Channel(s) : 1 channel
Channel layout : C
Sampling rate : 48.0 kHz
Compression mode : Lossy
Writing library : libopus unknown-fixed

Does it not accept .opus extension?

I’m sorry. I initially misunderstood.

Asterisk is going to assume .wav is pcm. You need to extract the .opus stream from the wav files and make them .opus files.

Only a small set of extensions are recognized, and the naming isn’t entirely consistent. For those containing wav:

.wav is RIFF, signed linear, mono, 16 bit PCM, 8kHz
.wav16 is RIFF, signed linear, mono, 16 bit PCM, 16kHz
.wav49 is RIFF, standard rate GSM (speech, in nominal 3.1kHz bandwidth)
.WAV is the same as .wav49

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.