Embedding audio in Quarto

How do I use audio in Quarto? Here are three ways.
tech
quarto
blogging
tutorial
obsidian
Date

Monday February 5, 2024

Topics
tech
quarto
blogging
tutorial
obsidian

I want to embed just a plain audio file in my blog post.

Check out the post Guitar: Clouds, where I embed some audio using the quarto video short link: Quarto – Videos.

My process:


Song snippet today: [2024-02-05-guitar-clouds](../audio/2024-02-05-guitar-clouds.m4a) 3rd capo, G, Em, C, G with some pinky action. 


<-- This works on safari, not chrome desktop for some reason --> 

![2024-02-05-guitar-clouds](../audio/2024-02-05-guitar-clouds.m4a)


Hope this helps someone!

Note, the second way (the ![]) approach didn’t work on Chrome Desktop, but works on Safari desktop, safari mobile, and chrome mobile:

Chrome doesn’t pick up the audio player

If I inspect the HTML I can see the audio tag is created in Chrome, it’s just not showing a player or anything.

But the mobile audio player is picked up:

Mobile safari

Mobile chrome

Obsidian

I like using this markdown syntax in Obsidian because that’s where I write my notes.

The markdown syntax

Because it appears like an audio player in app. The syntax is a quarto thing and renders nicely. The <audio> tag is supposed to work but doesn’t in my vault. In my app it looks like this;

Rendered in quarto

So yes, the markdown link is the most usable, works on most browsers, and works in Obsidian. Just doesn’t work on Chrome Web…(at least not on my version).

Seems also that using the <audio> tag breaks my quarto:

Broken file

In Summary

I’ve found two ways of showing audio in quarto. 1) using the image syntax in markdown and 2) using a video shortcode. The markdown syntax works great locally on my iPhone and on most browsers, but the video shortcode seems to work on all browsers.

_________________________

Bryan lives somewhere at the intersection of faith, fatherhood, and futurism and writes about tech, books, Christianity, gratitude, and whatever’s on his mind. If you liked reading, perhaps you’ll also like subscribing: