Skip to content

Commit

Permalink
Add voiceactivity action.
Browse files Browse the repository at this point in the history
This change adds support for the voice activity detection (VAD) feature
for microphones. It allows application to show a notification when user
is speaking but MediaStreamTrack is muted.
  • Loading branch information
jianjunz committed Jun 28, 2024
1 parent ceaac16 commit 298c998
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,11 @@ platform UI or media keys, thereby improving the user experience.
the action's intent is to open the media session in a
picture-in-picture window.
</li>
<li>
<dfn enum-value for=MediaSessionAction>voiceactivity</dfn>:
the action's intent is to notify the action handler that a voice
activity is started.
</li>
</ul>
</p>

Expand Down Expand Up @@ -541,6 +546,17 @@ platform UI or media keys, thereby improving the user experience.
{{MediaSessionActionHandler}} before running, as different tasks, the
steps defined to [$set a track's muted state$].
</p>
<p>
A user agent MUST invoke {{MediaSessionActionHandler}} for
{{MediaSessionAction/voiceactivity}} only when the voice activity is
detected from a source with one or more live {{MediaStreamTrack}}s. A user
agent MAY ignore a {{MediaSessionAction/voiceactivity}} action if all
{{MediaStreamTrack}}s associated with the source are not
{{MediaStreamTrack/muted}}. It is RECOMMENDED for user agents to set a
minimal interval for invoking {{MediaSessionActionHandler}} for
{{MediaSessionAction/voiceactivity}} based on privacy and power efficiency
policies.
</p>

<p class=note>
A page should only register a {{MediaSessionActionHandler}} for a <a>media
Expand Down Expand Up @@ -716,7 +732,8 @@ enum MediaSessionAction {
"hangup",
"previousslide",
"nextslide",
"enterpictureinpicture"
"enterpictureinpicture",
"voiceactivity"
};

callback MediaSessionActionHandler = undefined(MediaSessionActionDetails details);
Expand Down Expand Up @@ -1496,6 +1513,7 @@ parameter whose dictionary type is:
<li>{{MediaSessionActionDetails}} for {{MediaSessionAction/nextslide}}.</li>
<li>{{MediaSessionActionDetails}} for
{{MediaSessionAction/enterpictureinpicture}}.</li>
<li>{{MediaSessionActionDetails}} for {{MediaSessionAction/voiceactivity}}.</li>
</ul>

The <dfn dict-member for="MediaSessionActionDetails">action</dfn>
Expand Down

0 comments on commit 298c998

Please sign in to comment.