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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:06:46+00:00 2026-06-11T01:06:46+00:00

Values from my conversion to .dat format using sox does not seem to be

  • 0

Values from my conversion to .dat format using sox does not seem to be normalized – hope someone can see what I am doing wrong.

I am trying to do something similar to what is described in this great SO post about sox and gnuplot (I am sending the values to processing in Java, so a bit different context). The problem is that in my .dat file I get “only small values”, while the man pages says they will be normalized between -1 and 1.

After installing sox and mp3-handling packages, I do the following to test:

sox elevator.mp3 -c 1 -r 11000 elevator_mediumres.dat
cat elevator_mediumres.dat |cut -c21-33 > elevator_mediumres_values_only.dat
sort -n elevator_mediumres_values_only.dat > elevator_mediumres_values_only_sorted.dat 
# echo min $(head -1 elevator_mediumres_values_only_sorted.dat) max $(tail -1 elevator_mediumres_values_only_sorted.dat)

This gives the output “min -0.48370361 max 9.1552734e-05”. If I do the first command to wav instead of dat, the wav file sounds OK (as OK as 11kHz mono of Aerosmith’s “Love in an elevator” ever does). I could of course normalize manually the data afterwards, but I am hoping there is a a better and more straightforward way.

Thanks,

-S-

  • 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-11T01:06:47+00:00Added an answer on June 11, 2026 at 1:06 am

    You seem to have a major dc-shift in your file. Depending on what you need to do with the data, you probably need to remove that before normalizing. To do this with sox, first determine dc-shift. Here’s one way with sox, awk and bash:

    dc_shift=$(sox infile.wav -n stats 2>&1 | awk '/DC offset/ { print $3 }')
    

    Now apply dc-shift and normalization to the input file:

    sox infile.wav normalized.wav dcshift $(( -dc_shift )) gain -n
    

    sox commandline is built up like this:

    sox IN OUT EFFECTS
    

    Each effect is applied sequentially.

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

Sidebar

Related Questions

I've got a conversion utility that basically copies values from one table to another.
Getting error while inserting values into database (SQL Server 2008) Implicit conversion from data
I'm looking to perform a conversion of the values in a Ruby hash from
Can Automapper map values from a NameValueCollection onto an object, where target.Foo receives the
I need to subtract two 24-hour time values from 0 to 23 using JQuery.
I get a 'Conversion from type DBNull to String is not valid' error when
I want to take the values from the URL and perform a currency conversion
Possible Duplicate: returning multiple values from a function For example if you want a
I want to get values from a row with the largest certain value (in
I am getting the values from database as an array <?php foreach($this->getlist as $value){

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.