Skip to content

blocks() that also returns seek point/location of the block #205

@endolith

Description

@endolith

I want something with all the same options as blocks() except that it also tells you where you are in the file, so you don't have to figure it out yourself, since that can be complicated with start/stop/blocksize/overlap.

So instead of

>>> n = start
>>> for block in sf.blocks('stereo_file.wav', blocksize=1024):
>>>     pass  # do something with 'block'
>>>     n += blocksize - overlap

it would be something like

>>> for n, block in sf.enumerate_blocks('stereo_file.wav', blocksize=1024):
>>>     pass  # do something with 'block' and 'n'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions