Comments (6)
Created #59
from twolame.
Can you suggest how to test this?
Is it possible to create a suitable test WAV file using sox?
from twolame.
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.
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.
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.
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)
- twolame outputs a file with wrong audio duration HOT 2
- Obsolete keyword HOT 2
- Cleaning operation HOT 1
- Towards 0.4.0 HOT 5
- Would it make sense to use Exact-width integer types (eg uint16_t)? HOT 1
- Remove deprecated functions HOT 3
- Add twolame_get_extension() and twolame_set_extension() HOT 1
- Update NEWS to include summary of changes in 0.4.0 release HOT 3
- Add instructions for building from Git repo in README file HOT 3
- LT_INIT usage HOT 1
- windows compilation: -no-undefined must be added to LDFLAGS for the creation of the shared library HOT 5
- usage of DLL_EXPORT for symbol visibility is wrong HOT 3
- no rule to make twolame.1 HOT 4
- update automake required version HOT 1
- Release version 0.4.0 HOT 4
- autoreconf instead of autogen.sh HOT 2
- 0.3.13: Test suite is freezing HOT 8
- Add OSS-Fuzz
- Floating point input samples and libsndfile (not a bug)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twolame.