Waveform Audio Player #soundcloud

Demo to preview the settings

Introduction

Plugin delivers a versatile audio playback experience reminiscent of Soundcloud, featuring a sleek waveform display and comprehensive functionality. With controls for play, pause, stop, mute/unmute, adjustable volume, and playlist support, users can seamlessly manage their audio content. Customization options allow for tailored design integration, while features like image export, speed control, markers, and dynamic event triggers enhance user engagement and navigation.

How to setup

  • Place the plugin’s element “Audio Player - Waveform” on the page.
  • Define the audio file and the colors and options you would like to have in your player.

Plugin element “Audio Player - Waveform

Fields

Title
Description
Type
Unplayed Wave Color
The color of the unplayed part of the wave.
Color
Played Wave Color
The color of the played part of the wave.
Color
Waveform Type
The type of waveform visualization.
Dropdown(Rounded,Bars,Wavy)
Cursor Color
The color of the cursor / selector. The cursor represents the current playback position within the audio file.
Color
Audio File
The audio source file.
File
Stop all instances on play
This is useful when you have multiple instances of Waveform on the same page. If this value is yes, all players currently playing will pause/stop(depends on “Stop or Pause”) when this player starts playing. If set to “no” then all instances when this player starts playing other will not stop, will continue playing simultaneously.
Yes/No
Reset when stopped
When “Stop all instances on play” is checked, then this property set to “yes” makes all other instances stop when current instance plays, set to “no” makes them pause instead.
Yes/No
Speed
The speed of the Audio Player. 1 is normal. 0.5 is 2x slower. 2 is 2x faster, etc…
Number
Muted
Set property to “yes” this box if you want the Audio Player to be muted by default.
Yes/No
Hide scrollbar
Whether to hide the horizontal scrollbar when one would normally be shown. property provides a way to customize the appearance of the WaveSurfer waveform visualization by controlling the visibility of the scrollbar within its container.
Yes/No
Hide Cursor
Hide the mouse cursor when hovering over the waveform. By default it will be shown.
Yes/No
Normalize
Normalization ensures that the loudest part of the audio reaches a specified level without clipping or distortion, thereby improving the overall clarity and consistency of the audio playback.
Yes/No
Skip Length
Number of seconds to skip with skipForward and skipBackward actions.
Number
Preload Peaks
Check this box if you want to preload the peaks from your database for instant-rendering. By supplying this data, WaveSurfer can render the waveform more quickly and smoothly, as it doesn't have to calculate the peaks itself from the audio file.
Yes/No
Peaks Data (JSON fromat)
(Optional) This field will be the peaks of the current audio file as JSON format when “Preload Peaks”. It has to be the same output as what the custom state "Peaks Data (JSON)" outputs !
Text
Consider Audio as Played (sec)
Number of seconds that the audio has to be played to be considered as played. Once this number of seconds has been reached on the current audio, the event "Current Audio File can be considered as Played" will be fired. It may help you to build a listening counter feature.
Number
== Plugins Additional Features ==
Cursor Plugin
Determines whether the cursor feature is enabled or not. When enabled, player displays a vertical line that moves along with the users’s directions on the audio file. When disabled, this cursor line is not displayed.
Yes/No
Cursor Color
This property defines the color of the cursor line.
Color
---Markers - - -
Markers Plugin
This property determines whether the markers feature is enabled or not. When enabled, player allows users to add markers to the waveform, indicating specific points of interest, such as song sections or timestamps.
Yes/No
Initial Markers
(Optional) This property represents the initial set of markers that are loaded when player initializes. It has to be in JSON format, exactly the same that what the custom state "Markers Data (JSON)" gives you as output.
Text
---Media Session-—
Media Session
This property determines whether the integration with the Media Session API is enabled or not. The Media Session API provides metadata about the currently playing media to the operating system, allowing for better integration with system controls such as playback controls on lock screens or notifications.
Yes/No
Title
(Optional) The song title.
Text
Artwork (Image)
(Optional) The image that will be displayed.
Image
Artist
(Optional) The artist.
Text
Album
(Optional) The album.
Text
Only download on start? 💬 ⚠️.
⚠️ WARNING: If you are not using the Peaks Data, the waveform will NOT be displayed until the user clicks on "Start". When this option is enabled, the audio file will only start downloading when the start function is called. This avoid downloading long lists and improve performance. If you have a web page with multiple WaveSurfer instances but you don't want to fetch all the audio files immediately upon loading the page, setting thsi property to “unchecked” allows you to fetch audio files only when the WaveSurfer component is initialized.
Checkbox
Allow Downloading
Enables the audio to be downloaded by users
yes/no
Allow Controls
Allows to display/hide of default audio player.
Checkbox

Returned Values

Title
Description
Type
Is Playing
Indicates whether the media player is currently playing
Yes/No
Current Time (s)
Represents the current playback position in the media, measured in seconds.
Number
Total Duration (s)
Denotes the total duration of the media in seconds.
Number
Current Speed
Indicates the current playback speed of the media, such as 1x, 1.5x, or 2x.
Number
Is Muted
Indicates whether the media is currently muted
Yes/No
Is Loading
Indicates whether the media player is currently loading data, which might be useful for showing loading spinners or progress bars.
Yes/No
% Loaded
Represents the percentage of the media that has been loaded. This can be useful for displaying a progress indicator during loading.
Number
Image URL
An image representation of a waveform generated in action "Generate Image”
Text
Current Volume (/1)
Represents the current volume level of the media.
Number
Markers Data (JSON)
Contains data about markers associated with the media.
Text
Peaks Data (JSON format)
Contains precomputed peak data for the audio waveform, which can be used for visualizing the waveform more efficiently.
Text
Current Audio File can be considered as Played
Indicates whether the media is considered "played" based on the provided time in the fields.
Yes/No
Playlist - Number of Songs to be Played Next
Indicates the number of songs in a playlist or queue that are scheduled to be played next.
Number
Playlist - Title of Songs to be Played Next
Contains titles or names of songs in a playlist or queue that are scheduled to be played next.
Text List

Events

Title
Description
Started Playing
This event occurs when the audio playback starts.
Stopped Playing
This event occurs when the audio playback stops.
Has been Muted
This event occurs when the audio is muted.
Has been Unmuted
This event occurs when the audio is unmuted.
Is Loaded
This event indicates that the audio file is fully loaded and ready for playback.
Finished Playing
This event occurs when the audio playback reaches its end.
Image Generated
This event occurs when an image representation of the waveform is successfully generated and ready for use/display.
Volume Changed
This event occurs when the volume of the audio changes.
Marker Created
This event occurs when a marker is created on the waveform.
Markers Cleared
This event occurs when all markers on the waveform are cleared.
Peaks Loaded (ready to be saved in DB)
Is fired as soon as the peaks are loaded, saved into state "Peaks Data (JSON format)" and ready to be saved in database.
Current Audio File can be considered as Played
Is fired as soon as the current audio file has been played more than X seconds (defined in the Waveform settings).

Actions

Start

Stop

Pause

Set Speed

Set Muted

Generate Image

Load New File

Set Volume

Skip Forward

Skip Backward

Create Marker

Clear all Markers

Play Previous Track

Play Next Track

Add a new Song to the Playlist

Clear Playlist Queue

Remove a Song from the Playlist by its Name

Download Peak Data File

Changelogs