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

fix: pad audio arrays to same shape if sample rates differ #1880

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

Conversation

chrisammon3000
Copy link

@chrisammon3000 chrisammon3000 commented Apr 3, 2024

Description

Please refer to #1875 for a detailed description of the issue this fixes. When ffmpeg creates subclips of a video sometimes the audio sample rates are inconsistent causing an error due to different size arrays. To fix this the arrays are padded to ensure they are all the same shape before they are parsed as AudioNdArray.

Copy link
Member

@JoanFM JoanFM left a comment

Choose a reason for hiding this comment

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

It would be nice to add a test case to show that the problem is fixed.

@JoanFM
Copy link
Member

JoanFM commented Apr 4, 2024

Hey @chrisammon3000 ,

Thanks a lot for the contribution.

However we would ask you to submit a test case to make sure the error case is covered and to make sure that the commits are signed-off to ensure that we can merge the contribution.

Please take a look at our contributing guidelines (https://github.com/docarray/docarray/blob/main/CONTRIBUTING.md)

Copy link

codecov bot commented Apr 4, 2024

Codecov Report

Attention: Patch coverage is 36.36364% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 84.63%. Comparing base (febbdc4) to head (a574002).

Files Patch % Lines
docarray/typing/bytes/video_bytes.py 36.36% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1880      +/-   ##
==========================================
- Coverage   84.69%   84.63%   -0.06%     
==========================================
  Files         136      136              
  Lines        9263     9274      +11     
==========================================
+ Hits         7845     7849       +4     
- Misses       1418     1425       +7     
Flag Coverage Δ
docarray 84.63% <36.36%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

None yet

2 participants