https://github.com/helloworld017/looped-back
A node module to change loopback device (a.k.a "Listen to this device") in Windows.
https://github.com/helloworld017/looped-back
Last synced: about 1 year ago
JSON representation
A node module to change loopback device (a.k.a "Listen to this device") in Windows.
- Host: GitHub
- URL: https://github.com/helloworld017/looped-back
- Owner: HelloWorld017
- License: gpl-3.0
- Created: 2019-07-19T15:57:00.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T18:59:27.000Z (over 3 years ago)
- Last Synced: 2024-11-09T02:39:03.240Z (over 1 year ago)
- Language: C++
- Size: 58.6 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LoopedBack
A node module to change loopback device (a.k.a "Listen to this device") in Windows.
Codes imported from [mrbindraw/DemoStereoMix](https://github.com/mrbindraw/DemoStereoMix)
## Building
To compile the extension for the first time, run
```
$ npm i
```
All subsequent builds only need `npm run build`
## Usage
```node
$ node
> const LoopedBack = require('looped-back');
undefined
> const looped = new LoopedBack();
undefined
> looped.isInitialized();
true
> looped.getDevices(LoopedBack.DEVICE_ALL);
[
{
id: '{0.0.0.00000000}.{01234567-89ab-cdef-0123-456789abcdef}',
name: 'Speaker(High Definition Audio Device)'
},
{
id: '{0.0.0.00000000}.{12345678-90ab-cdef-1234-567890abcdef}',
name: 'Microphone(High Definition Audio Device)'
},
...
]
> const microphone = looped.getDevices(LoopedBack.DEVICE_CAPTURE)[0];
undefined
> const speaker = looped.getDevices(LoopedBack.DEVICE_RENDER)[0];
undefined
> looped.getLoopback(microphone.id); //returns null if loopback is disabled
null
> looped.setLoopback(microphone.id, speaker.id); //returns false if failed
true
> looped.getLoopback(microphone.id);
'{0.0.0.00000000}.{01234567-89ab-cdef-0123-456789abcdef}'
> looped.setLoopback(microphone.id); //disables loopback
true
> looped.setDefaultEndpoint(microphone.id, LoopedBack.ROLE_COMMUNICATION)
true
> looped.getDefaultEndpoint(LoopedBack.DEVICE_CAPTURE)[LoopedBack.ROLE_COMMUNICATION];
'{0.0.0.00000000}.{12345678-90ab-cdef-1234-567890abcdef}'
> looped.destroy();
undefined
```