![]() region-removed – When a region is removed.region-update-end – When dragging or resizing is finished.region-updated – When a region is updated.region-created – When a region is created.Callback will receive the Region object, and a MouseEvent object. region-dblclick - When the mouse double-clicks on a region.region-click - When the mouse clicks on a region.region-mouseleave - When the mouse leaves a region.region-mouseenter - When the mouse moves over a region.region-out– When playback leaves a region.region-in – When playback enters a region.Region events (exposed by the Regions plugin): Callback will receive a ScrollEvent object. ready – When audio is loaded, decoded and the waveform drawn.mouseup - When a mouse button goes up.Callback will receive (integer) loading progress in percents and (object) event target. loading – Fires continuously when loading via XHR or drag'n'drop.Callback will receive (string) error message. You can insert your own Web Audio nodes into the graph using the method setFilter(). toggleInteraction() – Toggle mouse interaction.toggleMute() – Toggles the volume on and off.stop() – Stops and goes to the beginning.skipForward() - Skip ahead skipLength seconds.skipBackward() - Rewind skipLength seconds.skip(offset) – Skip a number of seconds from the current position (use a negative value to go backwards).setVolume(newVolume) – Sets the playback volume to a new value (0 = silent, 1 = maximum). ![]() setPlaybackRate(rate) – Sets the speed of playback ( 0.5 is half speed, 1 is normal speed, 2 is double speed and so on). ![]() setFilter(filters) - For inserting your own WebAudio nodes into the graph.seekTo(progress) – Seeks to a progress (0=beginning, 1=end).seekAndCenter(progress) – Seeks to a progress and centers view (0 = beginning, 1 = end).playPause() – Plays if paused, pauses if playing.Optional start and end measured in seconds can be used to set the range of audio to play. play(]) – Starts playback from the current position.unAll() – Unsubscribes from all events.un(eventName, callback) – Unsubscribes from an event.See WaveSurfer Events section below for a list. on(eventName, callback) – Subscribes to an event.loadBlob(url) – Loads audio from a Blob or File object.load(url) – Loads audio from URL via XHR.getDuration() – Returns the duration of an audio clip in seconds.getCurrentTime() – Returns current progress in seconds.empty() – Clears the waveform as if a zero-length audio is loaded.destroy() – Removes events, elements and disconnects Web Audio nodes.init(options) – Initializes with the options listed above.The fill color of the waveform after the cursor.Īll methods are intentionally public, but the most readily available are the following: Number of seconds to skip with the skipForward() and skipBackward() methods. Otherwise the waveform is shrunk to the container width (see fillParent). Whether to scroll the container with a lengthy waveform. The fill color of the part of the waveform behind the cursor. ![]() Minimum number of pixels per second of audio. You can switch this parameter at any time later on. Whether the mouse interaction will be enabled at initialization. Whether to hide the horizontal scrollbar when one would normally be shown. Whether to fill the entire container or draw only according to minPxPerSec. The fill color of the cursor indicating the playhead position. AudioElement is a fallback for unsupported browsers.ĬSS-selector or HTML-element where the waveform should be drawn. In most cases you don't have to set this manually. Use your own previously initialized AudioContext or leave blank.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |