-
Notifications
You must be signed in to change notification settings - Fork 741
Get rid of typedefs/SignalInfo and replace AudioMetaData #761
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
Conversation
d9b4ad2 to
177a866
Compare
Codecov Report
@@ Coverage Diff @@
## master #761 +/- ##
==========================================
+ Coverage 89.16% 89.35% +0.19%
==========================================
Files 32 32
Lines 2566 2556 -10
==========================================
- Hits 2288 2284 -4
+ Misses 278 272 -6
Continue to review full report at Codecov.
|
vincentqb
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
| assert info.get_sample_rate() == sample_rate | ||
| assert info.get_num_frames() == sample_rate * duration | ||
| assert info.get_num_channels() == num_channels | ||
| assert info.sample_rate == sample_rate | ||
| assert info.num_frames == sample_rate * duration | ||
| assert info.num_channels == num_channels |
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.
The functions are still in there so the change is not BC breaking, right? Is there a reason why you are updating the tests then?
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.
The functions are still in there so the change is not BC breaking, right?
No. These get_* functions are removed so this is BC breaking.
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.
If a user tries to use them, what will happen? I don't see any instructions to the user on what to do?
177a866 to
e994869
Compare
e994869 to
c9eed5b
Compare
vincentqb
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.
Let's make sure we have the warnings in place to let the users know what to do if they encounter errors for missing operations.
That approach is good for stable released feature, but considering the product lifecycle of "sox_io" backed, which is still under heavy development, I do not think that really fits. |
What I meant above when I asked if something was BC-breaking was whether this was changing the existing "sox" (not "sox_io") interface. "sox_io" has not been part of a release yet, so we don't need to add warnings when we are changing the interface.
Can you clarify the response? |
This changes the function signature of |
vincentqb
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.
Thanks for clarifying :) LGTM
|
thanks |
This PR removes
typedefs.[h|cpp], movesSignalInfofromtorchaudionamespace totorchaudio::sox_io, removes dummy module from Python interface, then replaceinforeturn type withAudioMetaData.torchaudio::sox_io::SignalInfostruct was expected be data exchange structure between Python and C++ for allinfo,loadandsavefunction ofsox_iobackend. However, as I simplify the function signature ofsaveandload, they end up not needing such structure, and nowinfofunction is the only function that usetorchaudio::sox_io::SignalInfostruct.On Python API level, we can replace this struct with simple Python class while keeping Torchscript-ability. This removes the necessity to introduce dummy module because we no longer need to annotate
infofunction withtorchaudio::sox_io::SignalInfo.