Skip to main content
Known Participant
December 8, 2020
Question

play audio file

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 is closed to new replies. Start a new post to keep the conversation going.

    6 replies

    Community Expert
    December 9, 2020

    https://www.youtube.com/watch?v=hd2HyvdlIDk

     

    try this tutorial.

    Translate
    Yigal0D4BAuthor
    Known Participant
    December 10, 2020

    thank you

    this tutorial for actionscript3 i want lay audio in html5 canvas

     

    Translate
    kglad
    Community Expert
    Community Expert
    December 10, 2020

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

     

    playSound("song1");

    Translate
    kglad
    Community Expert
    Community Expert
    December 8, 2020

    as3 or html5?

     

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

    Translate