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 7457977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:23:26+00:00 2026-05-29T13:23:26+00:00

I am trying to implement ‘volume automation’ in a jQuery audio player I have

  • 0

I am trying to implement ‘volume automation’ in a jQuery audio player I have built.

As you can see form the picture below I have a line graph overlayed which has draggable points.

While the audio is playing an event fires every second (currently, I may up the frequency if needed) which collects the data.

The data I am returning is the audio position and the volume (determined from the height of the ‘point’… not the line itself.

This means that currently despite a slope being rendered the volume only changes when each individual point is reached in the song. (a point being a single ‘dot’ on the line.

enter image description here

I have chosen to do it this way performance reasons.

However, using this method means that I need to perform a calculation to work out the volume inbetween the points.

Math really is not my strong point and I can remember very little from my school days.

I am storing the variables currently as:-

  • x0 = Last point position
  • x1 = next point position
  • y0 = Last point
  • y1 = next point
  • position = current position in seconds

I hope the above makes sense!

If I remember correctly the equation needed is something to do with calculating the difference between the two points, so I assume this would just need a simple equation using the contents of the above variables.

The volume scale is 0-100. Therefore obiously a point at the top of the waveform should have a volume value of 100 and a point at the bottom should have a volume value of 0. With the individual points inbetween being calculated by the required equation.

If anyone can shed any light on this matter or help point me towards a solution It would be much appreciated!

  • 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-05-29T13:23:27+00:00Added an answer on May 29, 2026 at 1:23 pm

    So you want to find the volume(y) between two points? As in (position – x0) * (y1 – y0) + y0?

    Note that that is simplified based on the given that x0 and x1 are 1 unit apart.

    Full detail:

    Find slope: slope = (y1-y0)/(x1-x0)

    Find % we are between x0 and x1: distance = (position – x0) / (x1 – x0)

    slope * distance will give us the change thus far: change = slope * distance

    To find the new value, add the change to the last value: y position = change + y0;

    Re-substituting all the variables gives us:
    y0 + ( ((y1 – y0)/(x1 – x0)) * ((position – x0) / (x1 – x0)))

    If you’re sample is at 1 unit, you can leave out the (x1 – x0) term.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to implement a UITableView of names similar to the built-in Contacts iPhone app
Trying to implement the excellent jQuery bidirectional infite scroll as explained here: http://www.bennadel.com/blog/1803-Creating-A-Bidirectional-Infinite-Scroll-Page-With-jQuery-And-ColdFusion.htm For
Trying to implement clean URLs (without .form, .do, etc.) with Spring MVC 3.0 (actually
Trying to implement what I thought was a simple concept. I have a user
Trying to implement NSCopying for the first time, and I have a question about
Im trying to implement an asp.net textbox using the jQuery UI Autocomplete widget http://jqueryui.com/demos/autocomplete/#remote
Im trying to implement pagination using multiple searching criteria. Supposed I Have student table.
Trying to implement a simple load more functionality with jquery. The idea is to
Trying to implement the following behavior on an iPad. I have a map-centric application
Trying to implement a timer for my game that I'm making. I have a

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.