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

feat: Add support for Sox's compression(bitrate) argument #153

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

Conversation

adinhodovic
Copy link

Adds support for bitrate as parameter to output arguments. It is useful converting files to MP3 format. Requires a new version of soundfile(0.11.0) that supports MP3 formats alongside upgraded libsndfile version to 1.1.0. This is for the test_bitrate_valid test.

@lostanlen
Copy link
Member

Hello @adinhodovic, the new feature looks great but from what I can see you are changing one of the dependencies from pysoundfile to soundfile. Can you remind me what happened there? Is this because of dependency resolution?

@adinhodovic
Copy link
Author

hey @lostanlen, I believe the dependency was renamed in the PyPi registry and the newer versions were only found under soundfile.

Breaking Changes
The soundfile module has evolved rapidly in the past. Most notably, we changed the import name from import pysoundfile to import soundfile in 0.7. In 0.6, we cleaned up many small inconsistencies, particularly in the the ordering and naming of function arguments and the removal of the indexing interface.

@danihodovic
Copy link

It would be nice to have this merged @lostanlen

sox/transform.py Outdated
@@ -343,6 +344,9 @@ def _validate_output_format(self, output_format):
if channels is not None and channels <= 0:
raise ValueError('channels must be a positive number')

if not isinstance(bitrate, float) and bitrate is not None:
raise ValueError('bitrate must be an float or None')
Copy link
Member

Choose a reason for hiding this comment

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

grammar

must be a positive float ?

Copy link
Author

Choose a reason for hiding this comment

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

👍

@lostanlen
Copy link
Member

tests are failing on MP3 ?

Adds support for bitrate as parameter to output arguments. It is useful converting files to MP3 format. Requires a new version of soundfile(0.11.0) that supports MP3 formats alongside upgraded libsndfile version to 1.1.0. This is for the `test_bitrate_valid` test.
@adinhodovic
Copy link
Author

Can you re run the workflow, think the OS mp3 dependency was missing.

@grantgeorge
Copy link

👍 looking forward to this functionality being added

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.

4 participants