Skip to main content
Known Participant
December 8, 2020
Question

play audio file

  • December 8, 2020
  • 2 replies
  • 361 views

i am trying to play song from file

i wrote this code, but the ausdio does not work

var song = new Audio();
song.src='file.mp3';
song.play();

 

 

    This topic has been closed for replies.

    2 replies

    Community Expert
    December 9, 2020
    Yigal0D4BAuthor
    Known Participant
    December 10, 2020

    thank you

    this tutorial for actionscript3 i want lay audio in html5 canvas

     

    kglad
    Community Expert
    Community Expert
    December 10, 2020

    assign a linkage id (eg, "song1") and use

     

    playSound("song1");

    kglad
    Community Expert
    Community Expert
    December 8, 2020

    as3 or html5?

     

    is the mp3 in your library?  if so, assign a linkage name.