Skip to content

Detect whether media has sound #690

@joedolson

Description

@joedolson

If a media source doesn't have any sound, that should be detectable and communicated to the user.

You can use the media .audioTracks property to check whether there are audio tracks. If there are none, the video can be assumed to be silent.

You can use the Web Audio API to check for silence; but the processing is probably excessive. Might be better to add a flag for the user to declare that a video is silent.

if (videoElement.audioTracks && videoElement.audioTracks.length > 0) { return true; }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions