Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/native-bindings/libshout
libshout C++ bindings to Node.js
https://github.com/native-bindings/libshout
libshout xiph
Last synced: about 1 month ago
JSON representation
libshout C++ bindings to Node.js
- Host: GitHub
- URL: https://github.com/native-bindings/libshout
- Owner: native-bindings
- Created: 2021-01-11T03:03:32.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-07-05T05:44:34.000Z (over 1 year ago)
- Last Synced: 2024-10-13T23:05:47.713Z (2 months ago)
- Topics: libshout, xiph
- Language: C++
- Homepage: https://github.com/xiph/Icecast-libshout
- Size: 21.5 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# shou-t
### Installation
```
yarn add libshout
```### Usage
```ts
import {Shout} from 'libshout';async function run() {
const shout = new Shout();
shout.setHost('127.0.0.1');
shout.setProtocol(0);
shout.setPort(8000);
shout.setPassword('hackme');
shout.setMount('/example.ogg');
shout.setUser('source');
shout.setFormat(0);
shout.open();
const fd = await fs.promises.open(path.resolve(__dirname,'audio.ogg'), 'r');
const tmp = Buffer.allocUnsafe(1024 * 4);
while(1) {
const {bytesRead} = await fd.read(tmp, 0, tmp.byteLength, null);
if(bytesRead) {
shout.send(tmp.buffer.slice(0, bytesRead));
} else {
break;
}
shout.sync();
}
shout.close();
}
```