Optional
settings: Partial<ChannelSettings>Readonly
nameReadonly
settingsStatic
NameProperty that states whether this plugin considers itself ready for continued playback based on internal logic.
Triggers internal event of type PlayerInternalEventType.LoadedChanged
if property value was changed.
Property that states whether this plugin considers itself muted based on internal logic.
Triggers internal event of type PlayerInternalEventType.MutedChanged
if property value was changed.
Property describing the plugin name and version.
Get the current waveform data for each track. The return value is a Record<string, Float32Array>, where the keys are track id's and the values are Float32Array's containing the waveform data for that track. The length of the Float32Array is the fftSize (see setting) and each value represent a sample.
See web audio api for details: https://webaudio.github.io/web-audio-api/#AnalyserNode-methods
Get the current values of a specific audio tracks gain values.
The source url of the track.
Returns the waveforms data for each channel for the loudest part (part size determined by the fftSize setting) of the audio under a given duration.
The source of the track
Optional
options: { The options of the analysis
The duration in ms we should analyse (from now, regardless of players pause state).
Optional
progress?: ((current) => void)Optional callback to get the current highest measured value.
A promise containing the max measured dB value for each channel along with the waveform data for that particular part.
Return the current muted status of a specific track.
The source url of the audio track.
The channel to mute.
Return the muted state of all channels for a specific track.
The source url of the track.
Get the current waveform data for each channel. The return value is an array of Float32, where each Float32array represent a single channel. The length of the channel arrays is the fftSize (see setting) and each value represent a sample. The elements represent the current waveform.
See web audio api for details: https://webaudio.github.io/web-audio-api/#AnalyserNode-methods
The element to get current data from.
Get the current volume of individual channelCount for an audio track. This method will return an empty array if; The audio track cannot be found. The audio channels haven't been initialized (e.g. setChannels hasn't been called) and channelCount hasn't been set.
The source of the track.
Get the max RMS dB value for all tracks combined under a given time.
The duration in ms we should analyse (from now, regardless of players pause state).
Optional
progress: ((current) => void)Optional callback to get the current highest measured value.
A promise containing the max measured combined dB value for all tracks.
Use getTrackMaxRMSdB instead.
Get the max RMS dB value for a track under a given time.
The source of the track.
The duration in ms we should analyse (from now, regardless of players pause state).
Optional
progress: ((current) => void)Optional callback to get the current highest measured value.
A promise containing the max measured dB value for each channel.
Use getChannelMaxRMSdB instead.
Returns the waveforms data for each track for the loudest part (part size determined by the fftSize setting) of the audio under a given duration.
Optional
options: { The options of the analysis
The duration in ms we should analyse (from now, regardless of players pause state).
Optional
progress?: ((current) => void)Optional callback to get the current highest measured value.
A promise containing the max measured dB value for each channel along with the waveform data for that particular part.
Mutes a specific channel for a track. Leaves the gain value unchanged. Channel will be unmarked as solo if soloed before mute. The analyser node will output 0 for the cpecific channel while muted.
The source url of the audio track.
The channel to mute.
Register one or more audio tracks.
Rest
...tracks: ChannelTrack[]The audio track(s).
Reroute the the channels for an audio track to the specified routeMap.
The source url of the track to reroute.
The route configuration.
Resets channel routing for all current tracks to default routing defined by ChannelSettings.channelRouter
Method for checking if routing is different from default routing (defined by ChannelSettings.channelRouter) or not.
true if routing != default routing, else false
Set the gain on the channel of specified track on specified index.
The identifier or source of the track
Index of the channel
The gain value
Error if track does not exist or channel with index does not exist.
Set the volume of individual channels of a specific registered track. Note that the channels array must contain as many values as there are channels in the track.
The Source url of the track.
The volume value of each specific channel. Range [0, 1]
Update source url to track native element by. Used if native element already initialized.
The native element.
The new source url.
Optional
newChannelCount: numberThe channelCount of the new proxy, keeps previous proxies channel count if unset.
Optional
newId: stringThe new id of the file.
Optional
newChannelInterpretation: ChannelInterpretationthe channelInterpretation of the new proxy, keeps previous proxies channel interpretation if unset.
Channel control plugin
The channel control plugin enables features to manipulate individual channels within an audio track. The implemented features consist of:
The plugin heavily depends on the Web Audio Api.
How to use
By default the plugin register video and discrete audio tracks automatically. It is possible to disable this feature and register the tracks manually.
System requirements
The most robust setup in all cases is to use the setting
preferredOutputCount = 2
that will downmux the channels to a stereo output. This will work (at least) in, FireFox (Windows) and Chrome.To get a surround output to work, the browser needs to be able to detect that the system you are using is capable of such features. The most robust browser to detect this is Chrome in Windows and OS X.
Known limitations
Since this plugin is based on the Web Audio Api there are some browser specific bugs as follows.
AudioContext not allowed to start.
The web audio API have a limitation that it is not allowed to start before a user interaction in the page. if this happens you will se a console error stating, The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. To recover from this, you need to manually call the method
resumeAudioContext
after first interaction with the application.Firefox playback rate issue.
https://bugzilla.mozilla.org/show_bug.cgi?id=966247 When activating the Audio context, the playback rate gets reset to 1x and it is from this point not possible to adjust playback rate.
Firefox Linux, only left channel.
https://bugzilla.mozilla.org/show_bug.cgi?id=1435598
In Firefox Linux edition there are issues related to output
5.1
and7.1
audio. The result is that all channels are mapped to the left channel. Until the bug is resolved we cannot support surround features in Firefox. The bug appears in some form as soon as Firefox detects that the current sound card has surround capabilities.Encoding restrictions for ABR.
The channel layout property is sensitive when using MSE (Chrome). In order to make it work the following channel layouts are supported:
Safari issues.
There are some issues with the implementation of Web Audio Api in Safari that is not handled in the current implementation of the plugin. For now, the channel plugin does not support Safari.