0

While creating a page for word of the day, if I click on volume up icon I am able to listen to the word of the day but not in the same page, it redirects me to the path and I have to click on play button to listen to this audio file.

here's my code

   <div class="word-and-pronunciation">
        <a href="audio (1).mp3" tabindex="0">
            <h2 class="word-l-hover">jocose</h2>
        </a>                
        <a class="play-pron converted" data-lang="en_us" data-file="jocose" data-dir="j" href="javascript:void(0)" title="How to pronounce jocose(audio)" tabindex="0">play 
          <span class="play-box">.</span>
        </a>
   </div>
  • you can try this https://stackoverflow.com/questions/18274061/html-5-audio-tag-multiple-files – Viral Prajapati May 10 '18 at 08:07
  • this is not what i want... i have page for WORD OF THE DAY... where i m inserting Difficult Word on daily Basis... Next to that Word i have Volume-Up Icon by clicking on which i have audio file which is saved in my folder path, end user will be able to hear that ... but it redirects me to that audio file path, i want this audio to be played on the same page, if i click on Volume-Up Button – Rajendra Jadhav May 10 '18 at 08:11

2 Answers2

0

Your implementation is just a link to file. Try to use a simple HTML 5 audio.

Other ways you could find here.

andriishupta
  • 497
  • 4
  • 8
0

You can use the HTML5 audio tag, more details here

this is a sample code from the link above

<figure> <figcaption>Listen to the T-Rex:</figcaption> <audio controls src="/media/examples/t-rex-roar.mp3"> Your browser does not support the <code>audio</code> element. </audio> </figure>

Jimmy.B
  • 225
  • 2
  • 14