Drat! Audio files: codecs and containers -- incongruities

Drat! Audio files: codecs and containers -- incongruities

by Darki Tadin-Đurović -
Number of replies: 1
*** copied over (by original author) from:
Learn Moodle 3.7 Basics / Week 3: Making the Grade (24 - 30 June) / Any questions about week 3? / Drat! Audio files: codecs and containers -- incongruities
*** (I'm a participant of said MOOC) ***

Dear fellow Moodlers,

here I go again, fighting a battle of wills with iOS @ iPad and Learn Moodle app. (I've even analysed why: because it's summer now in the northern hemisphere and it's hot (> 30°C) and I cannot bear to add my laptop's heat output to the overall heat that surrounds me, so I sit in the shade with the iPad in my lap, for better or worse.) 

The crux of this post is that it's rather incongruent to teach us (in the Optional quiz on mobile learning and Moodle) that, for audio, it's best to use mp3 while having the Atto's sound recorder serve Opus-encoded audio in a matroska container...

How do I know? Well, again, I was browsing using Learn Moodle on iOS (because it was hot). I had enrolled a practice course and there was an ugly black rectangle where the audio player should have been (I started a chat with the course creator and found that out; later I logged in from Chromium @ Debian linux).

 app: Learn Moodle, OS: iOS 12.3.1, HW: iPad

Learn Moodle @ iOS (iPad) does not show audio player
(should I bother saying it does not play?)

The same goes when viewing from:

  • Dolphin web browser @ iPad:
    app: Dolphin, iOS 12..1, HW: iPad
  • Chrome web browser @ iPad:
    app: Chrome, iOS 12..1, HW: iPad

Now I'm curious enough to try the Moodle app (official app for mobile), iOS @ iPad:
app: Moodle, iOS 12..1, HW: iPad

Aha! An improvement! But alas: it does not play sad

Now I'm even more curious:

  • Learn Moodle app @ android 6.0 (HTC Desire)
    app: Learn Moodle, android 6.0, HW: HTC Desire
    plays just fine smile
  • Moodle (official app) @ android 6.0 (HTC Desire)
    app: Moodle, android 6.0, HW: HTC Desire
    also plays smile
  • ... and, last, but not least: Chromium web browser @ Debian 9 (laptop)
    app: Chromium, OS: Debian 9 (stretch), HW: Fujitsu laptop
    also plays smile

 

In the chat I'm having with the course creator, I find out that he had used Atto's sound recording feature (on Kubuntu, in Chrome? or in Dolphin?)  and he sent me the part of his HTML code:

<div class="mediaplugin mediaplugin_videojs"><div style="max-width:400px;"><audio controls="" data-setup-lazy="{&quot;language&quot;: &quot;en&quot;, &quot;fluid&quot;: true, &quot;controlBar&quot;: {&quot;fullscreenToggle&quot;: false}, &quot;aspectRatio&quot;: &quot;1:0&quot;}" id="id_videojs_5d12f320a6177_1" class="video-js" title="561288155658151-audio.ogg"><source src="https://learn.moodle.net/pluginfile.php/438159/mod_label/intro/561288155658151-audio.ogg" type="audio/ogg" /><a href="https://learn.moodle.net/pluginfile.php/438159/mod_label/intro/561288155658151-audio.ogg" class="_blanktarget">https://learn.moodle.net/pluginfile.php/438159/mod_label/intro/561288155658151-audio.ogg</a></audio></div></div>

During this chat, when he copy/pastes the HTML code, surprisingly, the HTML is interpreted and an audio player pops out right there, in the middle of our chat:app: Learn Moodle / chat, iOS 12..1, HW: iPad
(Chat screenshot: Learn Moodle @ iOS, iPad)

So, it's an ogg file. Further analysis reveals that it contains Opus-encoded audio stream in WebM (matroska) container:

ffmpeg
Input #0, matroska,webm, from '561288155658151-audio.ogg':
Metadata:
encoder : Chrome
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0(eng): Audio: opus, 48000 Hz, mono, fltp (default)

mediainfo
General
Complete name : 561288155658151-audio.ogg
Format : WebM
Format version : Version 4 / Version 2
File size : 284 KiB
Writing application : Chrome
Writing library : Chrome
IsTruncated : Yes

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

The doc "Audio" reads: 

Types of audio (sound) files

  • Moodle's default VideoJS player will play the following audio files: mp3, .aac, .flac, .m4a, .oga, .ogg, .wav

... and then further down:

Using the Moodle media icon

  • With your editing turned on, click into the HTML editor where you wish to embed your sound file. (It needs to be mp3.)

The doc "Media embedding" reads: 

The Multimedia plugins filter must be enabled and then specific players may be enabled or disabled from 'Manage media players' in Site administration.

The default player, VideoJS player supports

  • (video) mov, .mp4, .m4v, .mpeg, .mpe, .mpg, .ogv, .webm, .flv, .f4v
  • (audio) .mp3, .aac, .flac, .m4a, .oga, .ogg, .wav

 

Now what?

Regards,

Darki

*** end of original message ***
Well, I've been asked to post here and that's what I'm doing.
Best,
Darki
Average of ratings: -
In reply to Darki Tadin-Đurović

Re: Drat! Audio files: codecs and containers -- incongruities

by Susan Mangan -

We are painstakingly finding this out the hard way as well sad  Here is what I have so far should it help anyone else going forward (and should anyone out there have any contradictory information or other advice please do chime in!)  And perhaps some type of informational item can be added to this wiki page to give Moodle Admins and general users a heads up? https://docs.moodle.org/37/en/Media_embedding

UPDATE: I did find this after the fact which was helpful https://docs.moodle.org/37/en/RecordRTC

We have confirmed that the "Record audio" tool in the Atto editor works on the following latest browsers and devices:

  • Windows 10 - Firefox
  • Windows 10 - Chrome
  • Windows 10 - Edge
  • MAC - Chrome
  • MAC - Firefox
  • Android

The following browsers and devices are not currently supported:

  • IOS
  • MAC - Safari

What this means is, for users who wish to play this type of audio file on unsupported devices, they will have to install an app like VLC for Mobile or OPlayer HD in order to play OGG files on an iPhone, iPad, or iPod touch.