Skip to content

io.rdrecord() fails when sampto is 'end' #129

@atpage

Description

@atpage

Calling rdsamp() or rdrecord() with sampto='end' replaces sampto with sig_len from the header, which may be None, causing check_read_inputs() to fail. I have patched this locally in the case where sig_len is None by replacing sig_len with filesize*8/bits_per_sample/n_sig, where bits_per_sample is looked up in this dict keyed on record.fmt:

bits_per_sample = {
    '8':    8,
    '16':  16,
    '24':  24,
    '32':  32,
    '61':  16,
    '80':   8,
    '160': 16,
    '212': 12,
    '310': 32.0/3,
    '311': 32.0/3,
}

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