-
Notifications
You must be signed in to change notification settings - Fork 3k
Add num channels to audio #7840
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 num channels to audio #7840
Conversation
| samples = audio.get_all_samples() | ||
| buffer = BytesIO() | ||
| AudioEncoder(samples.data.cpu(), sample_rate=samples.sample_rate).to_file_like(buffer, format="wav") | ||
| num_channels = samples.data.shape[0] |
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.
This isn't strictly necessary but added it to be explicit
lhoestq
left a comment
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.
lgtm !
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Fixes #7837
We currently have the mono attribute for Audio documented but not used anywhere resulting in confusion for users. Since torchcodec does not know this attribute I suggest using
num_channels(currently supportedNone(leave unchanged), mono:1, stereo:2).I could also add a mono attribute but found that to be more confusing for developers and would restrict us if at any point in the future more than 2 channels are supported.