Skip to content

Detect whether media has sound #690

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; }

Activity

  1. added this to the 4.8 milestone on Sep 30, 2025
  2. joedolson commented on Dec 31, 2025

    @joedolson
    MemberAuthor

    The audioTracks property is only available with experimental flags enabled in most browsers, although it's been available for a long time. I'd consider this a relatively low priority enhancement, given that, and will bump it until there's better browser support.

    See https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/audioTracks#browser_compatibility

  3. removed this from the 4.8 milestone on Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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