-2

it's a dictionary, i want the play button of the word to play the audio first in normal speed and then (or on second click) in slow play rate (say 0.75) is there a way to do that

<script>function abarticulation(){var music = new Audio('new folder/abarticulation.mp3');   music.play()                
;}
</script><input type="button" value=  onclick="abarticulation()" />
Mr T
  • 75
  • 10
  • Not a fix but please note that the [](https://html.spec.whatwg.org/dev/input.html#the-input-element) tag does not use and does not need a closing slash and never has in any HTML specification. – Rob Aug 09 '22 at 11:33
  • thanks. for the quistion asked, any ideas? – Mr T Aug 12 '22 at 17:29
  • Does this answer your question? [Controlling audio speed of a mp3 file](https://stackoverflow.com/questions/23618845/controlling-audio-speed-of-a-mp3-file) – Lawrence Cherone Aug 21 '22 at 10:17
  • @LawrenceCherone No, the audio in the example above is loaded through javascript, and it's not HTML selector – Mr T Aug 21 '22 at 10:34
  • @user3840170 Hi, sorry to intrude, i saw some of your other answers, you seem an expert in audio, can you help – Mr T Aug 21 '22 at 10:54
  • see the accepted answer in the dupe, its javascript, all you need do is `music.playbackRate=0.5`, its a dupe no point repeating answers just to change `myaudio` var to `music`. – Lawrence Cherone Aug 21 '22 at 11:28

1 Answers1

0
myaudio=document.getElementById("audio1");
myaudio.playbackRate=0.5;
Mad7Dragon
  • 1,237
  • 1
  • 10
  • 21
  • 1
    the audio in the example above is not an Html selector but loaded through javascript – Mr T Aug 21 '22 at 10:32