WaveformPlaylistProvider.
usePlaylistControls
Access playback control methods and track manipulation functions.Import
Usage
Return Value
Returns an object with all playback and playlist control methods:Start playback. Optionally specify a start time and duration.Parameters:
startTime- Time in seconds to start playback from (default: current time)playDuration- Duration in seconds to play (default: play to end)
Pause playback. Maintains the current position.
Stop playback. May reset position depending on configuration.
Seek to a specific time in seconds.
Set the current playback position in seconds.
Mute or unmute a track.
Solo or unsolo a track. Soloed tracks mute all other tracks.
Set track volume (0-1).
Set track stereo pan (-1 to 1, where -1 is left, 0 is center, 1 is right).
Set the time selection range in seconds.
Select a track by ID for editing operations.
Set the time display format (‘seconds’, ‘hh:mm:ss’, ‘hh:mm:ss.u’).
Format a time value according to the current time format.
Zoom in on the waveform visualization.
Zoom out on the waveform visualization.
Set the master output volume (0-1).
Enable or disable automatic scrolling during playback.
Set the container element for automatic scrolling.
Ref to the scroll container element.
Enable continuous playback through annotations.
Link annotation endpoints for connected editing.
Enable or disable annotation editing.
React state setter for annotations array.
Set the currently active annotation by ID.
Enable or disable loop playback.
Set the loop region start and end times in seconds.
Set the loop region to match the current selection.
Clear the loop region.
usePlaylistState
Access current playlist state values.Import
Usage
Return Value
Whether continuous playback through annotations is enabled.
Whether annotation endpoints are linked for connected editing.
Whether annotations can be edited.
Whether automatic scrolling during playback is enabled.
Whether loop playback is enabled.
Array of annotation data objects.
ID of the currently active annotation.
Start time of the current selection in seconds.
End time of the current selection in seconds.
ID of the currently selected track for editing operations.
Start time of the loop region in seconds.
End time of the loop region in seconds.
usePlaybackAnimation
Access playback animation state and timing information. Use this for components that need to render in sync with audio playback at 60fps.Import
Usage
Return Value
Whether audio is currently playing.
Current playback time in seconds. Updates at 60fps during playback.
Ref to the current time value. Use this in animation loops to avoid stale closures.
AudioContext currentTime when playback started. Used for drift-free timing calculations.
Audio position in seconds when playback started.
Returns the current playback time from the engine. Auto-wraps at loop boundaries.This is the recommended way to get playback time in animation loops as it reads directly from
Transport.seconds for perfect audio sync.usePlaylistData
Access playlist data including tracks, audio buffers, and peaks.Import
Usage
Return Value
Total duration of the playlist in seconds.
Array of AudioBuffer objects for all tracks.
Array of peak data for all tracks. Each track contains an array of clip peaks.
Array of track objects with clips and metadata.
Array of track state objects (muted, soloed, volume, pan).
Whether the playlist has finished loading and is ready for playback.
Current zoom level in samples per pixel.
Sample rate of the audio in Hz.
Master output volume (0-1).
Whether zoom in is currently available.
Whether zoom out is currently available.
Current time display format.