Giter Club home page Giter Club logo

Comments (6)

eblanca avatar eblanca commented on September 25, 2024

Created #59

from twolame.

njh avatar njh commented on September 25, 2024

Can you suggest how to test this?

Is it possible to create a suitable test WAV file using sox?

from twolame.

eblanca avatar eblanca commented on September 25, 2024

Of course you can with sox.
Ensure you pass -e float -b 32 for the output file format and it should do the job. After this, you can check the file format with soxi.
Also, mplayer decodes many formats into floating point wav, by default (vorbis and m4a among others, IIRC).

from twolame.

njh avatar njh commented on September 25, 2024

Confirmed through manual testing:

~/Projects/twolame(master) $ cd tests
~/Projects/twolame/tests(master) $ sox testcase-22050.wav -e float -b 32 testcase-float32.wav
~/Projects/twolame/tests(master) $ ../frontend/twolame testcase-float32.wav testcase-float32.mp2
---------------------------------------------------------
Input Filename: testcase-float32.wav
Output Filename: testcase-float32.mp2
Input Format: WAV (Microsoft), 32 bit float
Input Duration: 0min 0.0sec
Input Library: libsndfile-1.0.28
---------------------------------------------------------
LibTwoLame 0.4.0 (http://www.twolame.org/)
Input : 22050 Hz, 2 channels
Output: 22050 Hz, Stereo
96 kbps CBR MPEG-2 LSF Layer II psycho model=3 
[De-emph:Off     Copyright:No     Original:Yes]
[Padding:Off     CRC:Off          Energy:Off  ]
---------------------------------------------------------
Encoding frame: 11/11 (100%)
Encoding Finished.
Total bytes written: 6.72 KB.
~/Projects/twolame/tests(master) $ sox testcase-float32.mp2 -n stat
Samples read:             23020
Length (seconds):      0.521995
Scaled by:         2147483647.0
Maximum amplitude:     0.000030
Minimum amplitude:    -0.000036
Midline amplitude:    -0.000003
Mean    norm:          0.000000
Mean    amplitude:    -0.000000
RMS     amplitude:     0.000001
Maximum delta:         0.000039
Minimum delta:         0.000000
Mean    delta:         0.000000
RMS     delta:         0.000001
Rough   frequency:         4700
Volume adjustment:    27622.500

from twolame.

njh avatar njh commented on September 25, 2024

Confirmed fixed with manual testing:

~/Projects/twolame(master) $ cd tests
~/Projects/twolame/tests(master) $ sox testcase-22050.wav -e float -b 32 testcase-float32.wav
~/Projects/twolame/tests(master) $ ../frontend/twolame testcase-float32.wav testcase-float32.mp2
---------------------------------------------------------
Input Filename: testcase-float32.wav
Output Filename: testcase-float32.mp2
Input Format: WAV (Microsoft), 32 bit float
Input Duration: 0min 0.0sec
Input Library: libsndfile-1.0.28
---------------------------------------------------------
LibTwoLame 0.4.0 (http://www.twolame.org/)
Input : 22050 Hz, 2 channels
Output: 22050 Hz, Stereo
96 kbps CBR MPEG-2 LSF Layer II psycho model=3 
[De-emph:Off     Copyright:No     Original:Yes]
[Padding:Off     CRC:Off          Energy:Off  ]
---------------------------------------------------------
Encoding frame: 11/11 (100%)
Encoding Finished.
Total bytes written: 6.72 KB.
~/Projects/twolame/tests(master) $ sox testcase-float32.mp2 -n stat
Samples read:             23020
Length (seconds):      0.521995
Scaled by:         2147483647.0
Maximum amplitude:     0.916997
Minimum amplitude:    -0.978987
Midline amplitude:    -0.030995
Mean    norm:          0.142265
Mean    amplitude:    -0.005834
RMS     amplitude:     0.188628
Maximum delta:         0.905128
Minimum delta:         0.000000
Mean    delta:         0.134944
RMS     delta:         0.175963
Rough   frequency:         3273
Volume adjustment:        1.021

from twolame.

njh avatar njh commented on September 25, 2024

Ugh, I think I broke the build by adding a test for this (477393c):
https://travis-ci.org/njh/twolame/builds/274356625

I suspect this is due to differing floating point conversions or perhaps dithering.

It would be good to have a test for this but may have to use something other than a MD5 to check the result.

from twolame.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.