Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SoX doesn't seem to like scientific notation #35

Closed
mcartwright opened this issue Jan 11, 2017 · 1 comment
Closed

SoX doesn't seem to like scientific notation #35

mcartwright opened this issue Jan 11, 2017 · 1 comment
Assignees
Labels

Comments

@mcartwright
Copy link

mcartwright commented Jan 11, 2017

Pysox needs to format its floats to not be scientific notation when formatting arguments for SoX, otherwise SoX seems to choke. I received

SoxError: Stdout: Stderr: sox FAIL pad: usage: {length[@position]}

when pysox was calling SoX with these arguments:

['sox', '-D', '-V2', u'../data/raw/scaper_audio/siren_wailing/5_siren_police.wav', '-c', '1', '/var/folders/xv/6nccdc7151j71bhvzlrvjhqm0000gp/T/tmpYCzbyz.wav', 'rate', '-h', '44100', 'trim', '0', '6.501565999', 'fade', 'q', '0.01', 'reverse', 'fade', 'q', '0.01', 'reverse', 'norm', '-7.36679718537', 'pad', '3.498434', '1.00000008274e-09']

Note the '1.00000008274e-09' at the end. When this number was changed to '0.00000000100000008274', this error went away, and when changed to a different sci notation number, e.g. '1.0e-3', the problem persisted.

@mcartwright
Copy link
Author

(change the occurrences of '{}'.format in your code that expect floats to '{:f}'.format)

@rabitt rabitt self-assigned this Jan 11, 2017
@rabitt rabitt added the bug label Jan 11, 2017
@rabitt rabitt modified the milestone: 1.3 Jan 11, 2017
@rabitt rabitt closed this as completed in 355e5af Feb 13, 2017
rabitt added a commit that referenced this issue Feb 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants