bastibe/PySoundFile — pull request #46 by mgeier (2014-06-17 14:16:04+00:00)
Title: read(): don't ignore frames if out is given?

We already discussed this in #37 and the current behavior is this:

If both `frames` and `out` are specified in `read()`, the value of `frames` is silently ignored (same with `dtype` and `always_2d`).

While implementing the `blocks()` feature (#35), however, I found that it may be better to change this behavior slightly.

What about not ignoring `frames`?

That would mean if `frames` is smaller than the length of `out`, it is taken into account, if it is larger, it would still be ignored.
This would be similar to the default Python indexing behavior, where an index larger than the maximum index is silently truncated to the maximum index.

`dtype` and `always_2d` would still be ignored.

Is this a bad idea?

I didn't add tests to not interfere with the py.test rewrite, but we should add some test cases for this afterwards.