Skip to content

docs(examples): add fake microphone input example - #2057

Closed
ashwinitodewar491 wants to merge 1 commit into
microsoft:mainfrom
ashwinitodewar491:feat/voice-input-automation-example
Closed

ashwinitodewar491 wants to merge 1 commit into
microsoft:mainfrom
ashwinitodewar491:feat/voice-input-automation-example

Conversation

@ashwinitodewar491

Copy link
Copy Markdown

## Summary

  • Add FakeMicrophoneInput, an example that feeds a WAV file to the page as microphone input in Chromium, using --use-fake-ui-for-media-stream, --use-fake-device-for-media-stream and --use-file-for-fake-audio-capture.
  • The page records with getUserMedia and a Web Audio analyser; the example waits until it detects the input. It plays a WAV file passed as an argument, or a tone generated in plain Java.
  • Add a section to examples/README.md covering usage and limitations: Chromium only, the file loops, a secure context is required, and webkitSpeechRecognition is not fed.

Fixes #2056

@ashwinitodewar491

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Josh Software Pune"

@yury-s

Copy link
Copy Markdown
Member

Thank you for the contribution, and for the careful write-up.

We keep examples/ to a handful of minimal tours of the Playwright API, and we'd rather not add recipes that depend on Chromium command-line switches: they are not part of Playwright's API, nothing in our CI exercises them, and they can change without notice. For the same reason the upstream request (microsoft/playwright#39297) was closed as not planned.

The approach itself is fine to use in your own tests, and this PR and #2056 will stay searchable for anyone looking for it. Closing in favor of the discussion in #2056.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add an example for feeding an audio file as microphone input (Chromium)

2 participants