Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8087381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:45:29+00:00 2026-06-05T18:45:29+00:00

I am creating a website for teaching some arabic words. I am including numbers,

  • 0

I am creating a website for teaching some arabic words. I am including numbers, ordinal numbers, days of the week etc. and I have a audio file that has them all and I would like to play it with mouseover or mouseclick. Now, I don’t want to have cut the audio into many pieces to make this work. Is there a way to call an audio file on mouseclick or mouseover and only play the file partially? For example I have an audio file that has numbers from 1 to 10 and let’s say each is a second long. When user click on number 5, I want to be able to call the numbers audio file and play the 5th second and stop. Is this possible? Following is my code that calls and plays the entire audio. Thank you!

<!DOCTYPE html>
<html>
<head>
    <title>Arabic Letters</title>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">

<script language="javascript" type="text/javascript">
 function playSound(soundfile) {
 document.getElementById("dummy").innerHTML=
 "<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />";
 }
 </script>

</head>

<body>
     <span id="dummy"></span> 

<a href="#" onclick="playSound('1-001_page3.mp3');"><p dir="rtl" lang="ar"
class="letter">واحِد</p></a>

</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T18:45:31+00:00Added an answer on June 5, 2026 at 6:45 pm

    I would use a global variable to set the current stopping point and bind a timeupdate listener to check if the time has been reached:

    var endTime = 0;
    // do this binding once at page load time
    myaudio.addEventListener("timeupdate", function() {
        if(this.currentTime >= endTime) {
            this.pause();
        }
    });
    

    With each event, set start time with myaudio.currentTime, the end time with endTime and the play() the audio:

    // plays the audioObj from start to stop times (in seconds)
    // call this for each snippet you wish to play (e.g., in an onclick handler)
    function playInterval (audioObj, start, stop) {
        audioObj.currentTime = start*1000;
        endTime = stop*1000;
        audio.play();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a website in asp.net but i have some issue.. I have
I am currently creating a website and have some javascript that works in all
I am working on creating website with Yii framework and I have a problem
I have been creating my website on a local environment and I had no
I am creating a website where user can upload video's audio's in different formats
I'm creating a website which is white, so I dont have any background assigned.
I'm creating a website that will have the admin upload documents available only to
So I am creating a website that I want to have an admin directory
I am creating a website using JavaScript/ASP.NET/C#/CSS/HTML/Compact SQL server. I have the majority of
I'm creating a website where I'm doing ajax requests to load some dynamic content

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.