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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:24:22+00:00 2026-05-23T17:24:22+00:00

Since there is currently no universal way to read live data from an audio

  • 0

Since there is currently no universal way to read live data from an audio track in JavaScript I’m using a small library/API to read volume data from a text file that I converted from an MP3 offline.

The string looks like this

!!!!!!!!!!!!!!!!!!!!!!!!!!###"~{~||ysvgfiw`gXg}i}|mbnTaac[Wb~v|xqsfSeYiV`R
][\Z^RdZ\XX`Ihb\O`3Z1W*I'D'H&J&J'O&M&O%O&I&M&S&R&R%U&W&T&V&m%\%n%[%Y%I&O'P'G
'L(V'X&I'F(O&a&h'[&W'P&C'](I&R&Y'\)\'Y'G(O'X'b'f&N&S&U'N&P&J'N)O'R)K'T(f|`|d
//etc...

and the idea is basically that at a given point in the song the Unicode number of the character at the corresponding point in the text file yields a nominal value to represent volume.

The library translates the data (in this case, a stereo track) with the following (simplified here):

getVolume = function(sampleIndex,o) {
    o.left = Math.min(1,(this.data.charCodeAt(sampleIndex*2|0)-33)/93);
    o.right = Math.min(1,(this.data.charCodeAt(sampleIndex*2+1|0)-33)/93);
    }

I’d like some insight into how the file was encoded in the first place, and how I’m making use of it here.

What is the significance of 93 and 33?

What is the purpose of the bitwise |?

Is this a common means of porting information (ie, does it have a name), or is there a better way to do it?

  • 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-23T17:24:23+00:00Added an answer on May 23, 2026 at 5:24 pm

    33 and 93 are used for normalizing values beween ! and ~.

    enter image description here

    var data = '!';
    Math.min(1,(data.charCodeAt(0*2)-33)/93); // will yield 0
    

     

    var data = '~';
    Math.min(1,(data.charCodeAt(0*2)-33)/93); // will yield 1
    

     

    var data = '"';
    Math.min(1,(data.charCodeAt(0*2)-33)/93); // will yield 0.010752688172043012
    

     

    var data = '#';
    Math.min(1,(data.charCodeAt(0*2)-33)/93); // will yield 0.021505376344086023
    
    // ... and so on
    

    The |0 is there due to the fact that sampleIndex*2 or sampleIndex*2+1 will yield a non-integer value when being passed a non-integer sampleIndex. |0 truncates the decimal part just in case someone sends in an incorrectly formatted sampleIndex (i.e. non-integer).

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

Sidebar

Related Questions

Since there is no way to join tables using Google App Engine datastore, I
I am trying to avoid using Net::SSH::Perl library since there is some problems in
Im using sphinxql currently and using mysql_real_escape_string on my $query but since there is
Hi all patient developers using spring data graph. Since there is so less documentation
Since there is no way that you can make the flash object transparent, there
When using ModelForm Within forms.py it would save a lot of time, since there
I suppose this isn't a huge deal, since there are other way around this
Currently looking to extract data from 2 tables and insert into another. Tables as
Is there currently a way to use the equivalent of the index-many-to-many NHibernate tag
I am currently transferring data from one database to another. My problem occurs with

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.