Skip to content
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.

TimeSlice.get_audio() #73

Open
bmcfee opened this issue Jun 12, 2016 · 1 comment
Open

TimeSlice.get_audio() #73

bmcfee opened this issue Jun 12, 2016 · 1 comment
Assignees

Comments

@bmcfee
Copy link
Contributor

bmcfee commented Jun 12, 2016

In implementing a few remix hacks yesterday, I kept finding myself wanting to construct a new Audio object from a time slice. Currently, the only way to do this is to extract the waveform by get_samples() and then instantiate a new Audio object.

This is undesirable for a few reasons:

  1. It's clunky
  2. It triggers a full copy and re-analysis of the audio

1 is okay, but 2 is a deal breaker if you're extracting short clips (eg beats), which may be too short for certain analyses to make sense.

What do folks think about making a shortcut for this kind of operation that propagates features (and timings) from the source audio of a time slice? This way, we can also preserve things like beat timings within a sliced interval, which might come out differently if the interval is analyzed independently of the full track.

If we're careful about things, the audio buffer could also be shared between audio objects by slicing.

@tkell
Copy link
Contributor

tkell commented Jul 17, 2016

I like this idea. I am a bit leery of sharing audio buffers, as I can see some weird, wait-why-did-that-buffer-change things popping up.

Would this be a function of a TimeSlice? TimeSlice.to_audio(), or something?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants