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.file_info.bitrate() Value error #159

Open
madt2709 opened this issue Jul 6, 2023 · 0 comments
Open

sox.file_info.bitrate() Value error #159

madt2709 opened this issue Jul 6, 2023 · 0 comments

Comments

@madt2709
Copy link

madt2709 commented Jul 6, 2023

When I call sox.file_info.bitrate() on a file I get the following error:

File "c:\Users\Theo\OneDrive\Documents\github\tinygrad\.venv\lib\site-packages\sox\file_info.py", line 64, in bitrate
    return float(output[:-1])
ValueError: could not convert string to float: '256k'

Whilst when running sox --i on the same file in terminal I get the following:

Input File     : 'dev-clean-wav/2277/149896/2277-149896-0000.wav'
Channels       : 1
Sample Rate    : 16000
Precision      : 16-bit
Duration       : 00:00:06.59 = 105440 samples ~ 494.25 CDDA sectors
File Size      : 211k
Bit Rate       : 256k
Sample Encoding: 16-bit Signed Integer PCM

After a bit of digging, it seems that the output of soxi is 256k\r and the \r doesn't get stripped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant