Skip to content
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

Fixing recording move to memory #1306

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Tomiinek
Copy link
Contributor

move_to_memory seems to fail for some cuts that have other audio soruce than file, no offset and duration matching the whole recording. I am fixing this for the url type, but probably still fails with the command or shar sources.

Also, I dont understand why there are Case #1 and Case #2 in this method (I suppose case 1 is here to avoid additional decoding), especially when the user specifies a format that does not match the format of the original source. It looks like the case 1 condition should check also for the formats. 🤔 So feel free to fix it properly.

Copy link
Collaborator

@pzelasko pzelasko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, pls fix the formatting and the other comment and LGTM

@@ -294,19 +295,21 @@ def _aslist(x):
return x

# Case #1: no opts specified, read audio without decoding and move it in memory.
if all(opt is None for opt in (channels, offset, duration)) or (
if format is None and (all(opt is None for opt in (channels, offset, duration)) or (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if all(opt is None for opt in (channels, offset, duration, format)) would be clearer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants