@livekit/rtc-node
Advanced tools
Comparing version 0.4.4 to 0.5.0
import type { OwnedAudioFrameBuffer } from './proto/audio_frame_pb.js'; | ||
import { AudioFrameBufferInfo } from './proto/audio_frame_pb.js'; | ||
export declare class AudioFrame { | ||
data: Uint16Array; | ||
data: Int16Array; | ||
sampleRate: number; | ||
channels: number; | ||
samplesPerChannel: number; | ||
constructor(data: Uint16Array, sampleRate: number, channels: number, samplesPerChannel: number); | ||
constructor(data: Int16Array, sampleRate: number, channels: number, samplesPerChannel: number); | ||
static create(sampleRate: number, channels: number, samplesPerChannel: number): AudioFrame; | ||
@@ -10,0 +10,0 @@ /** @internal */ |
@@ -14,3 +14,3 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc. | ||
static create(sampleRate, channels, samplesPerChannel) { | ||
const data = new Uint16Array(channels * samplesPerChannel); | ||
const data = new Int16Array(channels * samplesPerChannel); | ||
return new AudioFrame(data, sampleRate, channels, samplesPerChannel); | ||
@@ -24,3 +24,3 @@ } | ||
new FfiHandle(owned.handle.id).dispose(); | ||
return new AudioFrame(new Uint16Array(data.buffer), info.sampleRate, info.numChannels, info.samplesPerChannel); | ||
return new AudioFrame(new Int16Array(data.buffer), info.sampleRate, info.numChannels, info.samplesPerChannel); | ||
} | ||
@@ -27,0 +27,0 @@ /** @internal */ |
@@ -6,3 +6,3 @@ { | ||
"author": "LiveKit", | ||
"version": "0.4.4", | ||
"version": "0.5.0", | ||
"main": "dist/index.js", | ||
@@ -47,7 +47,7 @@ "types": "dist/index.d.ts", | ||
"optionalDependencies": { | ||
"@livekit/rtc-node-darwin-arm64": "0.4.4", | ||
"@livekit/rtc-node-darwin-x64": "0.4.4", | ||
"@livekit/rtc-node-linux-arm64-gnu": "0.4.4", | ||
"@livekit/rtc-node-linux-x64-gnu": "0.4.4", | ||
"@livekit/rtc-node-win32-x64-msvc": "0.4.4" | ||
"@livekit/rtc-node-darwin-arm64": "0.5.0", | ||
"@livekit/rtc-node-darwin-x64": "0.5.0", | ||
"@livekit/rtc-node-linux-arm64-gnu": "0.5.0", | ||
"@livekit/rtc-node-linux-x64-gnu": "0.5.0", | ||
"@livekit/rtc-node-win32-x64-msvc": "0.5.0" | ||
}, | ||
@@ -54,0 +54,0 @@ "engines": { |
@@ -7,8 +7,8 @@ <!-- | ||
# 📹🎙️Node.js real-time SDK for LiveKit | ||
# 📹🎙️Node.js realtime SDK for LiveKit | ||
[](https://npmjs.com/package/@livekit/rtc-node) | ||
[](https://github.com/livekit/node-sdks/actions/workflows/livekit-rtc.yml) | ||
[](https://npmjs.com/package/@livekit/rtc-node) | ||
[](https://github.com/livekit/node-sdks/actions/workflows/rtc-node.yml) | ||
Use this SDK to add real-time video, audio and data features to your Node app. By connecting to a self- or cloud-hosted <a href="https://livekit.io/">LiveKit</a> server, you can quickly build applications like interactive live streaming or video calls with just a few lines of code. | ||
Use this SDK to add realtime video, audio and data features to your Node app. By connecting to a self- or cloud-hosted <a href="https://livekit.io/">LiveKit</a> server, you can quickly build applications like interactive live streaming or video calls with just a few lines of code. | ||
@@ -21,3 +21,3 @@ | ||
## Using real-time SDK | ||
## Using realtime SDK | ||
@@ -80,3 +80,3 @@ ### Connecting to a room | ||
- [`basic_room`](https://github.com/livekit/node-sdks/tree/main/examples/basic_room): connect to a room | ||
- [`publish-wav`](https://github.com/livekit/node-sdks/tree/main/examples/publish-wav): connect to a room and publish a wave file | ||
@@ -83,0 +83,0 @@ ## Getting help / Contributing |
@@ -9,3 +9,3 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc. | ||
export class AudioFrame { | ||
data: Uint16Array; | ||
data: Int16Array; | ||
sampleRate: number; | ||
@@ -15,3 +15,3 @@ channels: number; | ||
constructor(data: Uint16Array, sampleRate: number, channels: number, samplesPerChannel: number) { | ||
constructor(data: Int16Array, sampleRate: number, channels: number, samplesPerChannel: number) { | ||
this.data = data; | ||
@@ -24,3 +24,3 @@ this.sampleRate = sampleRate; | ||
static create(sampleRate: number, channels: number, samplesPerChannel: number): AudioFrame { | ||
const data = new Uint16Array(channels * samplesPerChannel); | ||
const data = new Int16Array(channels * samplesPerChannel); | ||
return new AudioFrame(data, sampleRate, channels, samplesPerChannel); | ||
@@ -36,3 +36,3 @@ } | ||
return new AudioFrame( | ||
new Uint16Array(data.buffer), | ||
new Int16Array(data.buffer), | ||
info.sampleRate, | ||
@@ -39,0 +39,0 @@ info.numChannels, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1580365
123