0

I am currently using Playwright to interact with a webpage that makes calls to people. I need to record the call for the first 5 seconds and save the file locally for playback after execution. I cannot find a good solution for this anywhere. Any help would be greatly appreciated.

I need to record the browser audio for 5 seconds and store it. I don't mind if I have to capture the entire system audio but would prefer if I could just capture the browser audio. Currently using Java and Playwright OS : Windows 10

Lilpercy11
  • 86
  • 3

1 Answers1

0

For anyone facing the same issue I was having, check out FMedia once installed you can call the program via the command line and therefore Java by using the Java.Lang.Process library. I did : Process p = Runtime.getRuntime().exec(fmedia --record --dev-loopback=0 -o OutputFile.wav --globcmd=listen --until=5); This allowed me to record all system audio for 5 seconds. The --globcmd command also means you can stop the recording using another process if you wish. Check out FMedia documentation for more information or their GitHub page. https://github.com/stsaz/fmedia#install If anyone finds a more elegant solution or a native java solution please feel free to add your suggestion below, I just thought I would answer this thread for anyone else in my position.

Lilpercy11
  • 86
  • 3