boats-animator
boats-animator copied to clipboard
Import audio
The ability to import audio files should eventually exist to help with matching animations to dialogue etc.
An audio speed option should be available in conjunction that is independent of the FPS change feature (ie even though FPS = 15, if audio speed = 50%, playback at effectively 7.5 FPS).
Was just searching around the web and came across this. I thought I'd link it here.
https://wavesurfer-js.org/
Seems pretty nifty to add some time down the road when we want to add waveforms underneath our frame icons, or on an x-sheet (depending on which way we go with development).
Should be noted that I have received quite a few user requests for this feature recently
Should be noted that I have received quite a few user requests for this feature recently
Yeah, I saw the discussion on BiM. I still need to do some research on how JS handles audio & and possible ways to implement it in the app.
By playing around with https://wavesurfer-js.org/, as suggested by rioforce above, I was able to get the following result with less than 10 lines of JS + HTML. They provide a really powerful framework.
We should set the skipLength
property of the waveform to something proportional to their frame rate (1/15th of a second if animating on 15 FPS etc..), and then call the skipForward()
and skipBackward()
functions when new frames are being added or when the user is moving through frames in the timeline.
Began trying to implement this in the import-audio
branch. No promises still :)
https://css-tricks.com/introduction-web-audio-api/
Some of the data structure changes to support this are:
-
Take - add an
audioTracks: Track[]
field -
FileRefType - add
AUDIO
andBLANK
file types. A blank file enables audio represents space in the track before/after the audio file
the length (in frames) of an audio TrackItem will need to be calculated on import and recalculated if the take's frame rate is changed.
A few other notes:
- Should be able to move the start position of imported audio
- Audio should be shown on the X-sheet.
- Perhaps only allow one audio track to start for simplicity?
- May later wish to make audio trimmable