Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/soft-tigers-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@livekit/agents-plugin-soniox': minor
---

Add Soniox TTS support with configurable speaking speed.
64 changes: 64 additions & 0 deletions plugins/soniox/etc/agents-plugin-soniox.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
import { APIConnectOptions } from '@livekit/agents';
import { AudioBuffer as AudioBuffer_2 } from '@livekit/agents';
import { stt } from '@livekit/agents';
import { tts } from '@livekit/agents';

// @public (undocumented)
export class ChunkedStream extends tts.ChunkedStream {
constructor(tts: TTS, text: string, opts: TTSOptions, connOptions?: APIConnectOptions, abortSignal?: AbortSignal);
// (undocumented)
label: string;
// (undocumented)
protected run(): Promise<void>;
}

// @public (undocumented)
export interface ContextGeneralItem {
Expand Down Expand Up @@ -87,6 +97,17 @@ export interface STTOptions {
translation?: TranslationConfig;
}

// @public (undocumented)
export class SynthesizeStream extends tts.SynthesizeStream {
constructor(tts: TTS, opts: TTSOptions, connOptions?: APIConnectOptions);
// (undocumented)
close(): void;
// (undocumented)
label: string;
// (undocumented)
protected run(): Promise<void>;
}

// @public (undocumented)
export type TranslationConfig = {
type: 'one_way';
Expand All @@ -97,6 +118,49 @@ export type TranslationConfig = {
languageB: string;
};

// @public (undocumented)
export class TTS extends tts.TTS {
constructor(opts?: Partial<TTSOptions>);
// (undocumented)
close(): Promise<void>;
// (undocumented)
label: string;
// (undocumented)
get model(): string;
// (undocumented)
prewarm(): void;
// (undocumented)
get provider(): string;
// (undocumented)
stream(options?: {
connOptions?: APIConnectOptions;
}): SynthesizeStream;
// (undocumented)
synthesize(text: string, connOptions?: APIConnectOptions, abortSignal?: AbortSignal): tts.ChunkedStream;
// (undocumented)
updateOptions(opts: Partial<Pick<TTSOptions, 'model' | 'language' | 'voice' | 'speed'>>): void;
}

// @public (undocumented)
export interface TTSOptions {
// (undocumented)
apiKey?: string;
audioFormat: string;
// (undocumented)
bitrate?: number | null;
// (undocumented)
language: string;
// (undocumented)
model: string;
// (undocumented)
sampleRate: number;
speed: number;
// (undocumented)
voice: string;
// (undocumented)
websocketUrl: string;
}

// (No @packageDocumentation comment for this package)

```
1 change: 1 addition & 0 deletions plugins/soniox/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import { Plugin } from '@livekit/agents';

export * from './stt.js';
export * from './tts.js';

class SonioxPlugin extends Plugin {
constructor() {
Expand Down
Loading
Loading