The place for more technical questions for those who want to create new pagetypes or bespoke functionality.

Audio on click (without player)

  • Jonathan Smith
  • Auteur du sujet
  • Hors Ligne
  • Administrateur
  • Administrateur
Plus d'informations
il y a 2 ans 4 mois #8946 par Jonathan Smith
Audio on click (without player) a été créé par Jonathan Smith
Hi

Some time ago Takeshi Adachi showed me a way to add and edit some source code so that when a learner clicks on a word (or phrase?) a very short audio file plays, typically with the pronunciation of the word or phrase. I added this code;

<p>
<audio id="clip12" src="https://............/G_digital.mp3"> 
<a onclick="document.getElementById('clip12').play()"> digital</a></p>

where G_Digital is the filename, 'digital' is the word the learner clicks on, and a new audio id has to be created each time.

This is very useful when creating pages with lots of bits of text, each associated with a different audio file. It looks nicer than having lots of audio players dotted around the page. However, it's quite time-consuming to create these pages. Would it be possible to create a kind of variation of the Record Audio feature in the Toolbar, so that;
- the author highlights a word or phrase
- records the audio file
- the audio file is associated with the highlighted word/phrase so that it plays on click (without a player displaying)

Best wishes

Jonathan Smith

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 ans 4 mois #8956 par teacherjonny
Réponse de teacherjonny sur le sujet Audio on click (without player)
Yes! this is a great advantage. I do tis regularly on the web and I have all of the words recorded in a single mpl3 file and the start/ stop cues stored in an array. I also want to do this in xerte.
Jonathan Paradise

Connexion ou Créer un compte pour participer à la conversation.

Modérateurs: JohnSmith
Temps de génération de la page : 0.129 secondes
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo