Instantiate a PulseAudio client by providing the server address. PulseAudio server defaults to the following:
/run/user/<user_id>/pulse/native
4317
// Using UNIX socket
const client: PulseAudio = new PulseAudio('unix:/run/user/1001/pulse/native')
// Using TCP socket
const client: PulseAudio = new PulseAudio('tcp:localhost:4317')
The address of the PulseAudio server. Can be either the path to a UNIX domain socket or the network address of the server. For UNIX sockets prepend unix:
to the path. For TCP sockets the format is tcp:<host>:<port>
.
The path to the cookie to use when authenticating with the server. Typically located at ~/.config/pulse/cookie
.
Connects the client to the PulseAudio server. Won't retry if the server is not reachable or the connection attempt is refused. Times out after 5 seconds.
Disconnect the client from the PulseAudio server. Waits for the server to close the connection.
Specify the client name passed to the server when connecting.
The client name. Defaults to paclient
.
Gets details for the module instance identified by the specified numeric index.
The numerical index of the module instance to get details for.
Gets details for all loaded module instances.
Load the specified module with the specified arguments into the running sound server. Prints the numeric index of the module just loaded to STDOUT. You can use it to unload the module later.
Example
const moduleIndex = await client.loadModule('module-loopback', 'source=alsa_output.dac.stereo-fallback.monitor sink=app-output')
console.log(moduleIndex) // moduleIndex: 27
The name of the module to load.
Space separated list of arguments to pass to the module.
Unload the module instance identified by the specified numeric index.
The numeric index of the module to unload.
Gets PulseAudio server information.
Subscribe to PulseAudio server events.
Gets details for the sink instance identified by the specified symbolic name or numeric index.
The symbolic name or numerical index of the sink instance to get details for.
Gets details for all sink instances.
Sets the volume of the specified sink (identified by its symbolic name or numerical index).
The symbolic name or numerical index of the sink to set the volume of.
The volume to set the source to in percentage (0% - 100%).
Gets details for the sink input instance identified by the specified symbolic name or numeric index.
The symbolic name or numerical index of the sink input instance to get details for.
Gets details for all sink input instances.
Move the specified playback stream (identified by its numerical index) to the specified sink (identified by its numerical index).
The numerical index of the playback stream to move.
The numerical index of the sink to move the playback stream to.
Gets details for the source instance identified by the specified symbolic name or numeric index.
The symbolic name or numerical index of the source instance to get details for.
Gets details for all source instances.
Sets the volume of the specified source (identified by its symbolic name or numerical index).
The symbolic name or numerical index of the source to set the volume of.
The volume to set the source to in percentage (0% - 100%).
Gets details for the source output instance identified by the specified numeric index.
The numerical index of the source output instance to get details for.
Gets details for all source output instances.
Move the specified recording stream (identified by its numerical index) to the specified source (identified by its numerical index).
The numerical index of the recording stream to move.
The numerical index of the source to move the recording stream to.
Generated using TypeDoc
Implements the PulseAudio client.
Basic usage