Skip to content

ENH: Allow automatic resampling of audio files#6987

Merged
TEParsons merged 2 commits intopsychopy:devfrom
TEParsons:dev-enh-sound-resample
Nov 28, 2024
Merged

ENH: Allow automatic resampling of audio files#6987
TEParsons merged 2 commits intopsychopy:devfrom
TEParsons:dev-enh-sound-resample

Conversation

@TEParsons
Copy link
Copy Markdown
Contributor

@TEParsons TEParsons commented Nov 27, 2024

Two stages to this one:

  • Very simple implementation allowing the ptb backend specifically to do auto resampling by having _setSndFromArray create an AudioClip, do the resampling, then setup the AudioSlave using that clip's samples (in a new _setSndFromClip method)
  • Refactor to give all backends the same behaviour for processing files, arrays, notes, etc. into an AudioClip object (as nothing up to this point needs to be backend-specific), then have each backend implement a _setSndFromClip method (generally the same stuff as in _setSndFromArray but with thisArray = clip.samples at the beginning)

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 18.27957% with 76 lines in your changes missing coverage. Please review.

Project coverage is 50.82%. Comparing base (c855517) to head (c7f3ff7).
Report is 11 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #6987   +/-   ##
=======================================
  Coverage   50.81%   50.82%           
=======================================
  Files         340      340           
  Lines       62301    62318   +17     
=======================================
+ Hits        31660    31674   +14     
- Misses      30641    30644    +3     
Components Coverage Δ
app ∅ <ø> (∅)
boilerplate ∅ <ø> (∅)
library ∅ <ø> (∅)
vm-safe library ∅ <ø> (∅)

@TEParsons TEParsons requested a review from mdcutone November 27, 2024 12:22
@TEParsons TEParsons merged commit 7b6a005 into psychopy:dev Nov 28, 2024
@TEParsons TEParsons deleted the dev-enh-sound-resample branch November 29, 2024 10:06
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.

1 participant