Implements Output
interface using:
import {Output} from 'shairport-sync';
class CustomOutput extends Output
{
// This function must return the output name for 'shairport-sync' command's '--output' option.
get name () {
return 'my-custom-output-name';
}
// This function must return the output arguments for 'shairport-sync' command.
get args () {
return [
['-d', 'myValue']
];
}
start (proc) {
if (!this.started) return; // no-op if instance is started
super.start(proc); // Use main logic
// ... Put your custom logic here
}
}
The previous example will result in a command like:
shairport-sync --output my-custom-output-name -- -d myValue
Output
instances expose the folowing properties:
Name | Type | Read-Only | Default | Desciption |
---|---|---|---|---|
name |
String | true | Name of the output for shairport-sync command. |
|
args |
Array | true | Output arguments to be be passed to the shairport-sync command. |
|
started |
Boolean | true | false | Whether the output is started. |
Output
instances expose the folowing methods:
ShairportSync
instances expose the folowing methods:
Name | Arguments | Description | |||
---|---|---|---|---|---|
Name | Type | Required | Default | ||
start |
(process) |
Start airplay receiver output | |||
process |
ChildProcess | true | ChildProcess started by the receiver |
Class | Type | Default | Description |
---|---|---|---|
Pipe | Class | false | Pipe the output stream through a file. |
Stdout | Class | true | Pipe the output stream through stdout. |
Stream | Interface | false | Pipe the output PCM audio stream through a property. |