LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   what does Firefox use for audio output/playing (https://www.linuxquestions.org/questions/linux-desktop-74/what-does-firefox-use-for-audio-output-playing-4175735512/)

Skaperen 03-30-2024 08:19 PM

what does Firefox use for audio output/playing
 
suppose you connect to an internet radio station or view a video (with audio) from a wed site like YouTube with a web browser like Firefox. you do this through a firewall that restricts inbound connects in most cases (it might have logic to let you do insecure file transfers with FTP).

there are multiple ways for a process to output audio to the local speakers or audio system. what does Firefox do? which of many APIs does it use?

i am wanting to capture the audio Firefox, or any client program, is trying to play to me. normally Firefox is work fine for me. i want to set up (implement) a way to send that audio to another computer that has a special audio system attached.

frankbell 03-30-2024 08:47 PM

It would appear to be something called Audio Worklets.

lvm_ 03-31-2024 02:43 AM

You can capture application audio both at pulse and alsa: https://trac.ffmpeg.org/wiki/Capture/ALSA, https://trac.ffmpeg.org/wiki/Capture/PulseAudio.

Skaperen 03-31-2024 10:42 PM

Quote:

Originally Posted by lvm_ (Post 6493108)
You can capture application audio both at pulse and alsa: https://trac.ffmpeg.org/wiki/Capture/ALSA, https://trac.ffmpeg.org/wiki/Capture/PulseAudio.

these documents are describing how to capture audio from a hardware device, presumably input audio like a microphone i want to capture the audio a process is trying to play (to speaker or to ear buds depending on the setup). my thinking is to emulate some audio playback hardware or emulate the API that some library creates for programs to their output thing with (maybe via a client library ... that i would be inclined to emulate).

emulating speaker hardware is likely very difficult for a non-root user. emulating a library API is likely much easier, although not trivial.

lvm_ 04-01-2024 12:54 AM

Quote:

Originally Posted by Skaperen (Post 6493294)
these documents are describing how to capture audio from a hardware device

Ah... If you tried, like, reading them, or at least scrolling to the end glancing at headings... Spoiler: it's in examples.

Skaperen 04-02-2024 03:10 PM

Quote:

Originally Posted by lvm_ (Post 6493307)
Ah... If you tried, like, reading them, or at least scrolling to the end glancing at headings... Spoiler: it's in examples.

which would you recommend using? it looks like there will be a lot of work getting things working (needed modules are missing and packages either won't install or can't be found) so i want to focus until i get something to work. it would be nice to have some examples that can work with what a distro like Ubuntu has in it so nothing new needs to be installed. that or maybe a "winsound" emulator for Linux.


All times are GMT -5. The time now is 02:23 AM.