chrome-php / chrome

Instrument headless chrome/chromium instances from PHP
MIT License
2.2k stars 269 forks source link

How to record audio? #604

Open divinity76 opened 4 months ago

divinity76 commented 4 months ago

How can I record audio?

I know I can record video/rendering frames with Page.startScreencast + method:Page.screencastFrame , but don't know about audio

enricodias commented 4 months ago

I don't know if that's possible. I didn't see audio mentioned anywhere in the docs. The screencast is just like a sequence of screenshots.

divinity76 commented 4 months ago

Seems there is an experimental WebAudio API in DevTools Protocol: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-audioListenerCreated

I haven't tried actually implementing it /yet/ but seems it's possible 🤔