Re: [pulseaudio-discuss] How to create a virtual microphone with source set as default monitor device?

2020-09-28 Thread Sean Greenslade
On Tue, Sep 22, 2020 at 06:29:05AM -0700, guest271314 wrote:
> > Point Espeak's output to the "Feed Espeak" sink, and point your
> recording application at the "ESpeak output virtual mic".
> 
> What is meant by "point" here? How to do that?

It depends on the application. Most applications that use the pulse APIs
will offer some sort of selection box or drop-down for this. Otherwise
you may need to use pavucontrol / pacmd / your own app that interacts
with the pulse API.

> Were you able to successfully carry out the procedure yourself?

Yes, everything I listed in my previous email was tested on my Arch
setup.

> What would be ideal is to be able to control pavucontrol -t 2 GTK or
> Qt page from HTML.
> 
> Where in pavucontrol source code is Recording tab implemented?

https://gitlab.freedesktop.org/pulseaudio/pavucontrol/-/blob/master/src/mainwindow.cc

--Sean

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] How to create a virtual microphone with source set as default monitor device?

2020-09-22 Thread guest271314
> Point Espeak's output to the "Feed Espeak" sink, and point your
recording application at the "ESpeak output virtual mic".

What is meant by "point" here? How to do that?

Were you able to successfully carry out the procedure yourself?

What would be ideal is to be able to control pavucontrol -t 2 GTK or
Qt page from HTML.

Where in pavucontrol source code is Recording tab implemented?

On Tue, Sep 15, 2020 at 2:34 PM Sean Greenslade  wrote:
>
> On Sun, Sep 13, 2020 at 05:18:23PM +, guest271314 wrote:
> > This project started attempting to capture the output of
> > window.speechSynthesis.speak().
> >
> > Consider https://stackoverflow.com/a/43553706.
> >
> > If run $ pacmd list-sink-inputs will get
> >
> > index: 219
> > driver: 
> > flags:
> > state: RUNNING
> > sink: 4 
> > volume: mono: 64460 /  98% / -0.43 dB
> > balance 0.00
> > muted: no
> > current latency: 0.00 ms
> > requested latency: 0.59 ms
> > sample spec: s16le 1ch 22050Hz
> > channel map: mono
> >  Mono
> > resample method: speex-float-1
> > module: 14
> > client: 192 
> > properties:
> > media.name = "playback"
> > application.name = "speech-dispatcher-espeak-ng"
> > native-protocol.peer = "UNIX socket client"
> > native-protocol.version = "33"
> > application.process.id = "45464"
> > application.process.user = "ubuntu-studio"
> > application.process.host = "ubuntu-studio"
> > application.process.binary = "sd_espeak-ng"
> > application.language = "C"
> > window.x11.display = ":0.0"
> > application.process.machine_id = ""
> > application.process.session_id = ""
> > module-stream-restore.id =
> > "sink-input-by-application-name:speech-dispatcher-espeak-ng"
> >
> > $ pacmd list-sources
> >
> > 2 source(s) available.
> >   * index: 4
> > name: 
> > driver: 
> > flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
> > DYNAMIC_LATENCY
> > state: RUNNING
> > suspend cause: (none)
> > priority: 9040
> > volume: mono: 0 /   0% / -inf dB
> > balance 0.00
> > base volume: 20724 /  32% / -30.00 dB
> > volume steps: 65537
> > muted: yes
> > current latency: 4.60 ms
> > max rewind: 0 KiB
> > sample spec: s16le 1ch 48000Hz
> > channel map: mono
> >  Mono
> > used by: 1
> > linked by: 1
> > configured latency: 40.00 ms; range is 0.50 .. 2000.00 ms
> > card: 1 
> > module: 8
> > properties:
> > alsa.resolution_bits = "16"
> > device.api = "alsa"
> > device.class = "sound"
> > alsa.class = "generic"
> > alsa.subclass = "generic-mix"
> > alsa.name = "USB Audio"
> > alsa.id = "USB Audio"
> > alsa.subdevice = "0"
> > alsa.subdevice_name = "subdevice #0"
> > alsa.device = "0"
> > alsa.card = "1"
> > alsa.card_name = "USB Device 0x46d:0x804"
> > alsa.long_card_name = "USB Device 0x46d:0x804 at
> > usb-:00:12.0-1.4, high speed"
> > alsa.driver_name = "snd_usb_audio"
> > device.bus_path = "pci-:00:12.0-usb-0:1.4:1.2"
> > sysfs.path =
> > "/devices/pci:00/:00:12.0/usb1/1-1/1-1.4/1-1.4:1.2/sound/card1"
> > udev.id = "usb-046d_0804_0B17FC60-02"
> > device.bus = "usb"
> > device.vendor.id = "046d"
> > device.vendor.name = ""
> > device.product.id = "0804"
> > device.product.name = ""
> > device.serial = "046d_0804_0B17FC60"
> > device.form_factor = "webcam"
> > device.string = "hw:1"
> > device.buffering.buffer_size = "192000"
> > device.buffering.fragment_size = "96000"
> > device.access_mode = "mmap+timer"
> > device.profile.name = "mono-fallback"
> > device.profile.description = "Mono"
> > device.description = ""
> > module-udev-detect.discovered = "1"
> > device.icon_name = "camera-web-usb"
> > ports:
> > analog-input-mic: Microphone (priority 8700, latency offset 0
> > usec, available: unknown)
> > properties:
> > device.icon_name = "audio-input-microphone"
> > active port: 
> >
> > One part of what am trying to do is create a virtual microphone that
> > takes input from speech-dispatcher-espeak-ng persistently or route
> > output from speech-dispatcher-espeak-ng to the microphone, so that
> > when capture the microphone the output will be from speech-dispatcher.
> > How to achieve that?
>
> $ pacmd load-module module-null-sink sink_name=feed_espeak_to_me
> $ pacmd update-sink-proplist feed_espeak_to_me device.description="\"Feed 
> Espeak\""
> $ pacmd update-source-proplist virtual_mic_espeak_output 
> device.description="\"ESpeak output virtual mic\""
>
> Point Espeak's output to the "Feed Espeak" sink, and point your
> recording 

Re: [pulseaudio-discuss] How to create a virtual microphone with source set as default monitor device?

2020-09-15 Thread Sean Greenslade
On Sun, Sep 13, 2020 at 05:18:23PM +, guest271314 wrote:
> This project started attempting to capture the output of
> window.speechSynthesis.speak().
> 
> Consider https://stackoverflow.com/a/43553706.
> 
> If run $ pacmd list-sink-inputs will get
> 
> index: 219
> driver: 
> flags:
> state: RUNNING
> sink: 4 
> volume: mono: 64460 /  98% / -0.43 dB
> balance 0.00
> muted: no
> current latency: 0.00 ms
> requested latency: 0.59 ms
> sample spec: s16le 1ch 22050Hz
> channel map: mono
>  Mono
> resample method: speex-float-1
> module: 14
> client: 192 
> properties:
> media.name = "playback"
> application.name = "speech-dispatcher-espeak-ng"
> native-protocol.peer = "UNIX socket client"
> native-protocol.version = "33"
> application.process.id = "45464"
> application.process.user = "ubuntu-studio"
> application.process.host = "ubuntu-studio"
> application.process.binary = "sd_espeak-ng"
> application.language = "C"
> window.x11.display = ":0.0"
> application.process.machine_id = ""
> application.process.session_id = ""
> module-stream-restore.id =
> "sink-input-by-application-name:speech-dispatcher-espeak-ng"
> 
> $ pacmd list-sources
> 
> 2 source(s) available.
>   * index: 4
> name: 
> driver: 
> flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
> DYNAMIC_LATENCY
> state: RUNNING
> suspend cause: (none)
> priority: 9040
> volume: mono: 0 /   0% / -inf dB
> balance 0.00
> base volume: 20724 /  32% / -30.00 dB
> volume steps: 65537
> muted: yes
> current latency: 4.60 ms
> max rewind: 0 KiB
> sample spec: s16le 1ch 48000Hz
> channel map: mono
>  Mono
> used by: 1
> linked by: 1
> configured latency: 40.00 ms; range is 0.50 .. 2000.00 ms
> card: 1 
> module: 8
> properties:
> alsa.resolution_bits = "16"
> device.api = "alsa"
> device.class = "sound"
> alsa.class = "generic"
> alsa.subclass = "generic-mix"
> alsa.name = "USB Audio"
> alsa.id = "USB Audio"
> alsa.subdevice = "0"
> alsa.subdevice_name = "subdevice #0"
> alsa.device = "0"
> alsa.card = "1"
> alsa.card_name = "USB Device 0x46d:0x804"
> alsa.long_card_name = "USB Device 0x46d:0x804 at
> usb-:00:12.0-1.4, high speed"
> alsa.driver_name = "snd_usb_audio"
> device.bus_path = "pci-:00:12.0-usb-0:1.4:1.2"
> sysfs.path =
> "/devices/pci:00/:00:12.0/usb1/1-1/1-1.4/1-1.4:1.2/sound/card1"
> udev.id = "usb-046d_0804_0B17FC60-02"
> device.bus = "usb"
> device.vendor.id = "046d"
> device.vendor.name = ""
> device.product.id = "0804"
> device.product.name = ""
> device.serial = "046d_0804_0B17FC60"
> device.form_factor = "webcam"
> device.string = "hw:1"
> device.buffering.buffer_size = "192000"
> device.buffering.fragment_size = "96000"
> device.access_mode = "mmap+timer"
> device.profile.name = "mono-fallback"
> device.profile.description = "Mono"
> device.description = ""
> module-udev-detect.discovered = "1"
> device.icon_name = "camera-web-usb"
> ports:
> analog-input-mic: Microphone (priority 8700, latency offset 0
> usec, available: unknown)
> properties:
> device.icon_name = "audio-input-microphone"
> active port: 
> 
> One part of what am trying to do is create a virtual microphone that
> takes input from speech-dispatcher-espeak-ng persistently or route
> output from speech-dispatcher-espeak-ng to the microphone, so that
> when capture the microphone the output will be from speech-dispatcher.
> How to achieve that?

$ pacmd load-module module-null-sink sink_name=feed_espeak_to_me
$ pacmd update-sink-proplist feed_espeak_to_me device.description="\"Feed 
Espeak\""
$ pacmd update-source-proplist virtual_mic_espeak_output 
device.description="\"ESpeak output virtual mic\""

Point Espeak's output to the "Feed Espeak" sink, and point your
recording application at the "ESpeak output virtual mic".

--Sean

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] How to create a virtual microphone with source set as default monitor device?

2020-09-13 Thread guest271314
This project started attempting to capture the output of
window.speechSynthesis.speak().

Consider https://stackoverflow.com/a/43553706.

If run $ pacmd list-sink-inputs will get

index: 219
driver: 
flags:
state: RUNNING
sink: 4 
volume: mono: 64460 /  98% / -0.43 dB
balance 0.00
muted: no
current latency: 0.00 ms
requested latency: 0.59 ms
sample spec: s16le 1ch 22050Hz
channel map: mono
 Mono
resample method: speex-float-1
module: 14
client: 192 
properties:
media.name = "playback"
application.name = "speech-dispatcher-espeak-ng"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "33"
application.process.id = "45464"
application.process.user = "ubuntu-studio"
application.process.host = "ubuntu-studio"
application.process.binary = "sd_espeak-ng"
application.language = "C"
window.x11.display = ":0.0"
application.process.machine_id = ""
application.process.session_id = ""
module-stream-restore.id =
"sink-input-by-application-name:speech-dispatcher-espeak-ng"

$ pacmd list-sources

2 source(s) available.
  * index: 4
name: 
driver: 
flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
DYNAMIC_LATENCY
state: RUNNING
suspend cause: (none)
priority: 9040
volume: mono: 0 /   0% / -inf dB
balance 0.00
base volume: 20724 /  32% / -30.00 dB
volume steps: 65537
muted: yes
current latency: 4.60 ms
max rewind: 0 KiB
sample spec: s16le 1ch 48000Hz
channel map: mono
 Mono
used by: 1
linked by: 1
configured latency: 40.00 ms; range is 0.50 .. 2000.00 ms
card: 1 
module: 8
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "USB Audio"
alsa.id = "USB Audio"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "1"
alsa.card_name = "USB Device 0x46d:0x804"
alsa.long_card_name = "USB Device 0x46d:0x804 at
usb-:00:12.0-1.4, high speed"
alsa.driver_name = "snd_usb_audio"
device.bus_path = "pci-:00:12.0-usb-0:1.4:1.2"
sysfs.path =
"/devices/pci:00/:00:12.0/usb1/1-1/1-1.4/1-1.4:1.2/sound/card1"
udev.id = "usb-046d_0804_0B17FC60-02"
device.bus = "usb"
device.vendor.id = "046d"
device.vendor.name = ""
device.product.id = "0804"
device.product.name = ""
device.serial = "046d_0804_0B17FC60"
device.form_factor = "webcam"
device.string = "hw:1"
device.buffering.buffer_size = "192000"
device.buffering.fragment_size = "96000"
device.access_mode = "mmap+timer"
device.profile.name = "mono-fallback"
device.profile.description = "Mono"
device.description = ""
module-udev-detect.discovered = "1"
device.icon_name = "camera-web-usb"
ports:
analog-input-mic: Microphone (priority 8700, latency offset 0
usec, available: unknown)
properties:
device.icon_name = "audio-input-microphone"
active port: 

One part of what am trying to do is create a virtual microphone that
takes input from speech-dispatcher-espeak-ng persistently or route
output from speech-dispatcher-espeak-ng to the microphone, so that
when capture the microphone the output will be from speech-dispatcher.
How to achieve that?


On Tue, Sep 8, 2020 at 9:24 PM Sean Greenslade  wrote:
>
> On Mon, Sep 07, 2020 at 05:03:59PM -0700, guest271314 wrote:
> > > I doubt that will be possible. Pavucontrol makes use of the native
> > > pulseaudio APIs, which are not exposed to javascript.
> >
> > If mpv can be embedded in an HTML document
> > https://github.com/Kagami/mpv.js it should be possible to embed
> > pavucontrol or pavucontrol-qt
> > (https://doc.qt.io/qt-5/qtwebchannel-javascript.html ;
> > https://medium.com/@petar.koretic/why-you-should-use-qt-qml-for-you-next-cross-platform-application-part-1-desktop-5e6d8856b7b4)
> > in particular in a browser; for example using WebAssembly; WASI;
> > Native Messaging; at least the ability to control Recording tab (-t 2)
> > from JavaScript or an HTML form.
>
> Electron is a whole separate discussion. Electron applications have
> different levels of access to the system than the vanilla chromium
> browser.
>
> > > After reading through those bug reports and related issue links, it's
> > > pretty clear that this is not a use case that they are particularly
> > > interested in supporting.
> >
> > The majority of own repositories at github are dedicated to fixing
> > WontFix; supporting SSML parsing; variable width and height video
> > capture with ability to merge multiple 

Re: [pulseaudio-discuss] How to create a virtual microphone with source set as default monitor device?

2020-09-08 Thread guest271314
> Electron is a whole separate discussion. Electron applications have
different levels of access to the system than the vanilla chromium
browser.

Native Messaging provides access to the system.

> With the amount of work you're seeming to have put into workarounds,
maybe you would be better off writing a proper native application?

Yes. Am filtering the most consistent approach. Am far more familiar
with front-end (HTML, JavaScript) than
C, C++, Rust, etc., thus most of the workarounds are web platform
based. From perspective here there should be a very simple function,
captureSystemAudio() that does only that.

On Tue, Sep 8, 2020 at 9:24 PM Sean Greenslade  wrote:
>
> On Mon, Sep 07, 2020 at 05:03:59PM -0700, guest271314 wrote:
> > > I doubt that will be possible. Pavucontrol makes use of the native
> > > pulseaudio APIs, which are not exposed to javascript.
> >
> > If mpv can be embedded in an HTML document
> > https://github.com/Kagami/mpv.js it should be possible to embed
> > pavucontrol or pavucontrol-qt
> > (https://doc.qt.io/qt-5/qtwebchannel-javascript.html ;
> > https://medium.com/@petar.koretic/why-you-should-use-qt-qml-for-you-next-cross-platform-application-part-1-desktop-5e6d8856b7b4)
> > in particular in a browser; for example using WebAssembly; WASI;
> > Native Messaging; at least the ability to control Recording tab (-t 2)
> > from JavaScript or an HTML form.
>
> Electron is a whole separate discussion. Electron applications have
> different levels of access to the system than the vanilla chromium
> browser.
>
> > > After reading through those bug reports and related issue links, it's
> > > pretty clear that this is not a use case that they are particularly
> > > interested in supporting.
> >
> > The majority of own repositories at github are dedicated to fixing
> > WontFix; supporting SSML parsing; variable width and height video
> > capture with ability to merge multiple tracks into a single media
> > container, or stream media without a container; streaming audio
> > potentially infinite input streams, that is, a dynamic Internet radio
> > station; capturing speech synthesis output from Web Speech API, which
> > is the origin of this use case of capturing system audio output.
> >
> > > May I perhaps suggest using a different
> > > browser?  Firefox had no problem with monitor inputs last time I
> > > checked.
> >
> > Interestingly, am completing testing of another workaround where since
> > Firefox does capture monitor devices, a new, dedicated instance of
> > Nightly is started prior to launching Chromium, the MediaStreamTrack
> > and MediaStream therefrom are added to a WebRTC RTCPeerConnection, and
> > currently using clipboard for signaling which is not ideal though is
> > one way to exchange text data between different browsers, accessing
> > the monitor device at Chromium instance generated at Nightly
> > https://gist.github.com/guest271314/04a539c00926e15905b86d05138c113c.
> > That approach avoids writing and reading raw PCM to memory.
>
> With the amount of work you're seeming to have put into workarounds,
> maybe you would be better off writing a proper native application?
>
> > > No idea, I've never done it myself. The example listed in the online
> > > docs shows a simple stereo swap, so you could presumably adapt it by
> > > switching the channels to be non-swapped (and of course substitute your
> > > specific master source name).
> >
> > Not sure precisely how to begin.
> >
> > Am still trying to gather the specific commands in code that
> > pavucontrol uses when setting the stream at the UI. Am not certain
> > what to pass to pactl move-source-output at what time
> > https://gitlab.freedesktop.org/pulseaudio/pavucontrol/-/issues/91#note_590795.
>
> If you read the documentation (e.g. man pactl), it seems pretty
> straightforward:
>
> > move-source-output ID SOURCE
> >  Move the specified recording stream (identified by its numerical 
> > index) to the specified source (identified by its symbolic name or 
> > numerical index).
>
> So you need to find the specific source output index (ID) and your new
> target source (SOURCE). I started an audacity session recording my
> microphone, and ran the "pactl list source-outputs" command. This gave
> me the index. I then ran the "pactl list sources" to find my target
> source name. The switch command (for my setup) then looked like this:
>
> > pactl move-source-output 203 pulse_send_nofx.monitor
>
> --Sean
>
> ___
> pulseaudio-discuss mailing list
> pulseaudio-discuss@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] How to create a virtual microphone with source set as default monitor device?

2020-09-08 Thread Sean Greenslade
On Mon, Sep 07, 2020 at 05:03:59PM -0700, guest271314 wrote:
> > I doubt that will be possible. Pavucontrol makes use of the native
> > pulseaudio APIs, which are not exposed to javascript.
> 
> If mpv can be embedded in an HTML document
> https://github.com/Kagami/mpv.js it should be possible to embed
> pavucontrol or pavucontrol-qt
> (https://doc.qt.io/qt-5/qtwebchannel-javascript.html ;
> https://medium.com/@petar.koretic/why-you-should-use-qt-qml-for-you-next-cross-platform-application-part-1-desktop-5e6d8856b7b4)
> in particular in a browser; for example using WebAssembly; WASI;
> Native Messaging; at least the ability to control Recording tab (-t 2)
> from JavaScript or an HTML form.

Electron is a whole separate discussion. Electron applications have
different levels of access to the system than the vanilla chromium
browser.

> > After reading through those bug reports and related issue links, it's
> > pretty clear that this is not a use case that they are particularly
> > interested in supporting.
> 
> The majority of own repositories at github are dedicated to fixing
> WontFix; supporting SSML parsing; variable width and height video
> capture with ability to merge multiple tracks into a single media
> container, or stream media without a container; streaming audio
> potentially infinite input streams, that is, a dynamic Internet radio
> station; capturing speech synthesis output from Web Speech API, which
> is the origin of this use case of capturing system audio output.
> 
> > May I perhaps suggest using a different
> > browser?  Firefox had no problem with monitor inputs last time I
> > checked.
> 
> Interestingly, am completing testing of another workaround where since
> Firefox does capture monitor devices, a new, dedicated instance of
> Nightly is started prior to launching Chromium, the MediaStreamTrack
> and MediaStream therefrom are added to a WebRTC RTCPeerConnection, and
> currently using clipboard for signaling which is not ideal though is
> one way to exchange text data between different browsers, accessing
> the monitor device at Chromium instance generated at Nightly
> https://gist.github.com/guest271314/04a539c00926e15905b86d05138c113c.
> That approach avoids writing and reading raw PCM to memory.

With the amount of work you're seeming to have put into workarounds,
maybe you would be better off writing a proper native application?

> > No idea, I've never done it myself. The example listed in the online
> > docs shows a simple stereo swap, so you could presumably adapt it by
> > switching the channels to be non-swapped (and of course substitute your
> > specific master source name).
> 
> Not sure precisely how to begin.
> 
> Am still trying to gather the specific commands in code that
> pavucontrol uses when setting the stream at the UI. Am not certain
> what to pass to pactl move-source-output at what time
> https://gitlab.freedesktop.org/pulseaudio/pavucontrol/-/issues/91#note_590795.

If you read the documentation (e.g. man pactl), it seems pretty
straightforward:

> move-source-output ID SOURCE
>  Move the specified recording stream (identified by its numerical index) 
> to the specified source (identified by its symbolic name or numerical index).

So you need to find the specific source output index (ID) and your new
target source (SOURCE). I started an audacity session recording my
microphone, and ran the "pactl list source-outputs" command. This gave
me the index. I then ran the "pactl list sources" to find my target
source name. The switch command (for my setup) then looked like this:

> pactl move-source-output 203 pulse_send_nofx.monitor

--Sean

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] How to create a virtual microphone with source set as default monitor device?

2020-09-07 Thread guest271314
> I doubt that will be possible. Pavucontrol makes use of the native
pulseaudio APIs, which are not exposed to javascript.

If mpv can be embedded in an HTML document
https://github.com/Kagami/mpv.js it should be possible to embed
pavucontrol or pavucontrol-qt
(https://doc.qt.io/qt-5/qtwebchannel-javascript.html ;
https://medium.com/@petar.koretic/why-you-should-use-qt-qml-for-you-next-cross-platform-application-part-1-desktop-5e6d8856b7b4)
in particular in a browser; for example using WebAssembly; WASI;
Native Messaging; at least the ability to control Recording tab (-t 2)
from JavaScript or an HTML form.

> After reading through those bug reports and related issue links, it's
pretty clear that this is not a use case that they are particularly
interested in supporting.

The majority of own repositories at github are dedicated to fixing
WontFix; supporting SSML parsing; variable width and height video
capture with ability to merge multiple tracks into a single media
container, or stream media without a container; streaming audio
potentially infinite input streams, that is, a dynamic Internet radio
station; capturing speech synthesis output from Web Speech API, which
is the origin of this use case of capturing system audio output.

> May I perhaps suggest using a different
browser?  Firefox had no problem with monitor inputs last time I
checked.

Interestingly, am completing testing of another workaround where since
Firefox does capture monitor devices, a new, dedicated instance of
Nightly is started prior to launching Chromium, the MediaStreamTrack
and MediaStream therefrom are added to a WebRTC RTCPeerConnection, and
currently using clipboard for signaling which is not ideal though is
one way to exchange text data between different browsers, accessing
the monitor device at Chromium instance generated at Nightly
https://gist.github.com/guest271314/04a539c00926e15905b86d05138c113c.
That approach avoids writing and reading raw PCM to memory.

> No idea, I've never done it myself. The example listed in the online
docs shows a simple stereo swap, so you could presumably adapt it by
switching the channels to be non-swapped (and of course substitute your
specific master source name).

Not sure precisely how to begin.

Am still trying to gather the specific commands in code that
pavucontrol uses when setting the stream at the UI. Am not certain
what to pass to pactl move-source-output at what time
https://gitlab.freedesktop.org/pulseaudio/pavucontrol/-/issues/91#note_590795.


On Mon, Sep 7, 2020 at 2:31 PM Sean Greenslade  wrote:
>
> On Mon, Sep 07, 2020 at 12:31:22AM -0700, guest271314 wrote:
> > > There are a couple of options. One is to simply redirect the sink input
> > > once it is opened (e.g. with pavucontrol).
> >
> > That option is used at
> > https://github.com/guest271314/captureSystemAudio#launch_pavucontrol.
> >
> > For the pavucontrol option the next goal is to embed pavucontrol in an
> > HTML document.
>
> I doubt that will be possible. Pavucontrol makes use of the native
> pulseaudio APIs, which are not exposed to javascript.
>
> > > If you really need a non-monitor source device to be present, I think
> > > your best option would be module-remap-source. It shouldn't be too hard
> > > to come up with a "remap" that's just a passthrough:
> > >
> > > https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/#module-remap-source
> >
> > Chromium is expecting a microphone device. Currently if a monitor is
> > set at command line the capture throws an exception, see
> > https://bugs.chromium.org/p/chromium/issues/detail?id=931749.
>
> After reading through those bug reports and related issue links, it's
> pretty clear that this is not a use case that they are particularly
> interested in supporting. May I perhaps suggest using a different
> browser?  Firefox had no problem with monitor inputs last time I
> checked.
>
> > Have so far tried kernel module and null-sink without achieving
> > capture of system audio.
> >
> > What is the command for the remap option for this case?
>
> No idea, I've never done it myself. The example listed in the online
> docs shows a simple stereo swap, so you could presumably adapt it by
> switching the channels to be non-swapped (and of course substitute your
> specific master source name).
>
> https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/#module-remap-source
>
> --Sean
>
> ___
> pulseaudio-discuss mailing list
> pulseaudio-discuss@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] How to create a virtual microphone with source set as default monitor device?

2020-09-07 Thread Sean Greenslade
On Mon, Sep 07, 2020 at 12:31:22AM -0700, guest271314 wrote:
> > There are a couple of options. One is to simply redirect the sink input
> > once it is opened (e.g. with pavucontrol).
> 
> That option is used at
> https://github.com/guest271314/captureSystemAudio#launch_pavucontrol.
> 
> For the pavucontrol option the next goal is to embed pavucontrol in an
> HTML document.

I doubt that will be possible. Pavucontrol makes use of the native
pulseaudio APIs, which are not exposed to javascript.

> > If you really need a non-monitor source device to be present, I think
> > your best option would be module-remap-source. It shouldn't be too hard
> > to come up with a "remap" that's just a passthrough:
> >
> > https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/#module-remap-source
> 
> Chromium is expecting a microphone device. Currently if a monitor is
> set at command line the capture throws an exception, see
> https://bugs.chromium.org/p/chromium/issues/detail?id=931749.

After reading through those bug reports and related issue links, it's
pretty clear that this is not a use case that they are particularly
interested in supporting. May I perhaps suggest using a different
browser?  Firefox had no problem with monitor inputs last time I
checked.

> Have so far tried kernel module and null-sink without achieving
> capture of system audio.
> 
> What is the command for the remap option for this case?

No idea, I've never done it myself. The example listed in the online
docs shows a simple stereo swap, so you could presumably adapt it by
switching the channels to be non-swapped (and of course substitute your
specific master source name).

https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/#module-remap-source

--Sean

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] How to create a virtual microphone with source set as default monitor device?

2020-09-07 Thread guest271314
> There are a couple of options. One is to simply redirect the sink input
once it is opened (e.g. with pavucontrol).

That option is used at
https://github.com/guest271314/captureSystemAudio#launch_pavucontrol.

For the pavucontrol option the next goal is to embed pavucontrol in an
HTML document.

> If you really need a non-monitor source device to be present, I think
your best option would be module-remap-source. It shouldn't be too hard
to come up with a "remap" that's just a passthrough:

> https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/#module-remap-source

Chromium is expecting a microphone device. Currently if a monitor is
set at command line the capture throws an exception, see
https://bugs.chromium.org/p/chromium/issues/detail?id=931749.

Have so far tried kernel module and null-sink without achieving
capture of system audio.

What is the command for the remap option for this case?

On Sun, Sep 6, 2020 at 11:59 PM Sean Greenslade  wrote:
>
> On Sat, Sep 05, 2020 at 09:10:36AM -0700, guest271314 wrote:
> > Chromium browser does not support capture of monitor devices when
> > navigator.mediaDevices.getUserMedia() is called. Chromium only
> > supports capture of non-monitor microphone input devices.
> >
> > How to create a virtual microphone with source set as default monitor
> > device so that Chromium browser recognizes the virtual device as a
> > microphone while the source input for the microphone is the default
> > monitor?
>
> There are a couple of options. One is to simply redirect the sink input
> once it is opened (e.g. with pavucontrol).
>
> If you really need a non-monitor source device to be present, I think
> your best option would be module-remap-source. It shouldn't be too hard
> to come up with a "remap" that's just a passthrough:
>
> https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/#module-remap-source
>
> --Sean
>
> ___
> pulseaudio-discuss mailing list
> pulseaudio-discuss@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] How to create a virtual microphone with source set as default monitor device?

2020-09-07 Thread Sean Greenslade
On Sat, Sep 05, 2020 at 09:10:36AM -0700, guest271314 wrote:
> Chromium browser does not support capture of monitor devices when
> navigator.mediaDevices.getUserMedia() is called. Chromium only
> supports capture of non-monitor microphone input devices.
> 
> How to create a virtual microphone with source set as default monitor
> device so that Chromium browser recognizes the virtual device as a
> microphone while the source input for the microphone is the default
> monitor?

There are a couple of options. One is to simply redirect the sink input
once it is opened (e.g. with pavucontrol).

If you really need a non-monitor source device to be present, I think
your best option would be module-remap-source. It shouldn't be too hard
to come up with a "remap" that's just a passthrough:

https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/#module-remap-source

--Sean

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss