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

Test sound files #122

Merged
merged 4 commits into from
Dec 31, 2019
Merged

Test sound files #122

merged 4 commits into from
Dec 31, 2019

Conversation

keggsmurph21
Copy link
Collaborator

These patches add support for loading (but not playing back) .wav, .flac, .ogg, and .mp3 files. Unfortunately, there is a lot of code repetition between these classes as they're all basically wrappers around a pydub.AudioSegment.

However, we need to separate them out into different classes because

  1. They handle different file extensions / mime types
  2. They rely on the third party library pydub, and we don't want to be importing that in base.py.

Copy link
Collaborator

@calebho calebho left a comment

Choose a reason for hiding this comment

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

Overall lgtm. Will leave to you to decide whether you want to introduce an extra layer of indirection to reduce code repetition

ultratrace2/model/files/loaders/flac.py Show resolved Hide resolved
ultratrace2/model/files/loaders/flac.py Show resolved Hide resolved
ultratrace2/model/files/loaders/mp3.py Show resolved Hide resolved
ultratrace2/model/files/loaders/ogg.py Show resolved Hide resolved
ultratrace2/model/files/loaders/wav.py Show resolved Hide resolved
keggsmurph21 added a commit that referenced this pull request Dec 31, 2019
There needs to be some class sitting between SoundFileLoader and the
concrete children since
 - each child shares a lot of code with siblings
 - each child needs the `pydub` external library, which may not exist
   on all systems

See #122 for more context.
keggsmurph21 added a commit that referenced this pull request Dec 31, 2019
There needs to be some class sitting between SoundFileLoader and the
concrete children since
 - each child shares a lot of code with siblings
 - each child needs the `pydub` external library, which may not exist
   on all systems

See #122 for more context.
@keggsmurph21 keggsmurph21 merged commit a915ea9 into master Dec 31, 2019
@keggsmurph21 keggsmurph21 deleted the test-sound-files branch December 31, 2019 17:04
keggsmurph21 added a commit that referenced this pull request Dec 31, 2019
There needs to be some class sitting between SoundFileLoader and the
concrete children since
 - each child shares a lot of code with siblings
 - each child needs the `pydub` external library, which may not exist
   on all systems

See #122 for more context.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants