Skip to content

sox.file_info.bitrate() Value error #159

Open
@madt2709

Description

@madt2709

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions