-
Notifications
You must be signed in to change notification settings - Fork 108
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
Add seeking to rawread and macca, and tests #73
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!! I'm excited to have some real unit tests here too. I've left a few comments inline.
audioread/macca.py
Outdated
@@ -323,6 +328,11 @@ def read_data(self, blocksize=4096): | |||
blob = data[:size] | |||
yield blob | |||
|
|||
def seek(self, pos): | |||
"""Seeks to the position in the file""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style nitpicking: it's nice to write docstrings (a) in the imperative voice, and (b) as complete sentences, including a period. So I suggest:
Seek to a position in the file.
|
||
#### wavetest.wav | ||
|
||
Produced with `make_test_wave.py` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little confusing that there are files called test.wav
and wavtest.wav
. Maybe it would be useful to describe what each one is for, and how they're different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using test.wav
for the macca
backend--- I'll find some better names for it. We also might not need both
@sampsyo
WIP towards #71 and #72 . On the path of adding seeking, I did a variety of things:
block_samples
intoaudio_open
. It works inmacca
andrawread
and I'm sure it's broken (viaUnexpected keyword arg
) in the other backends.rawread
andmacca
rawread
andmacca
Moving
block_samples
to the init for the other backends, and adding seeking to them is still needed. But let me know how this looks!Todos: