beetbox / beetbox/audioread

Move `block_size` KWarg to initialization?

Open
#72 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
538
Forks
112
PR merge metrics
No merged PRs in 30d

Description

I'm browsing through the backends, and it looks kind of inconsistent how we sometimes hand `block_size` or `block_samples` to `read_data`, and sometimes we pass it to the initialization?

Furthermore, `def audio_open(path):` doesn't take a `block_size` parameter, so users can't use it unless they use a backend directly.

I think we could improve the lib by adding `block_size` to `audio_open`. For the existing backends that have `read_data(blocksize=*)` we could still allow them to override blocksize on the read_data level. It shouldn't be breaking change if we do it this way.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing audio_open(path) and the backend initialization and read_data(blocksize=*) entry points to compare how block_size and block_samples are currently passed. The change is done when audio_open accepts block_size, existing read-time overrides remain possible, and the behavior is consistent across the affected backends.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
audio-video-rtc
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.