Skip to content

Instantly share code, notes, and snippets.

@milhaud1201
Last active March 5, 2023 16:33
Show Gist options
  • Save milhaud1201/ae5e33cce953e8c658e4c195dae48b53 to your computer and use it in GitHub Desktop.
Save milhaud1201/ae5e33cce953e8c658e4c195dae48b53 to your computer and use it in GitHub Desktop.
Embedding audio in blog posts

Audio source settings

  1. Save audio files to gdrive
  2. Copy the link that was created after creating it was create.
  3. Cut only the ID part and apply it with the change link.

original link => https://drive.google.com/file/d/ID/view?usp=sharing
change link => https://docs.google.com/uc?export=open&id=ID

<audio src="https://docs.google.com/uc?export=open&id=1oOqKvNO3v51P6b1mFB7_sIkMSNfYQ37l" controls preload>
  <p>Your browser does not support the audio element.</p>
</audio>

HTML Audio

<audio controls>
  <source src="horse.ogg" type="audio/ogg">
  <source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

HTML Audio - Media Types

File Format Media Type
MP3 audio/mpeg
OGG audio/ogg
WAV audio/wav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment