-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
414 additions
and
484 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
/** @type {import('jest').Config} */ | ||
module.exports = { | ||
preset: 'ts-jest/presets/default-esm', | ||
testEnvironment: 'node', | ||
extensionsToTreatAsEsm: ['.ts'], | ||
preset: "ts-jest/presets/default-esm", | ||
testEnvironment: "node", | ||
extensionsToTreatAsEsm: [".ts"], | ||
globals: { | ||
'ts-jest': { | ||
useESM: true, | ||
}, | ||
"ts-jest": { | ||
useESM: true, | ||
}, | ||
}, | ||
transformIgnorePatterns: [ | ||
'/node_modules/(?!(emittery)/)', | ||
], | ||
}; | ||
|
||
transformIgnorePatterns: ["/node_modules/(?!(emittery)/)"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
import { Tts } from "../api/resources/tts/client/Client"; | ||
import Websocket from "./Websocket"; | ||
|
||
|
||
export class StreamingTTSClient extends Tts { | ||
constructor(options: Tts.Options = {}) { | ||
super(options); | ||
} | ||
|
||
/** | ||
* Get a WebSocket client for streaming TTS. | ||
* | ||
* | ||
* @param options - Options for the WebSocket client. | ||
* @returns A WebSocket client configured for streaming TTS. | ||
*/ | ||
websocket({ sampleRate, container, encoding }: { | ||
websocket({ | ||
sampleRate, | ||
container, | ||
encoding, | ||
}: { | ||
sampleRate: number; | ||
container?: string; | ||
encoding?: string | ||
encoding?: string; | ||
}): Websocket { | ||
return new Websocket({ sampleRate, container, encoding }, {cartesiaVersion: "2024-06-10", ...this._options}); | ||
return new Websocket({ sampleRate, container, encoding }, { cartesiaVersion: "2024-06-10", ...this._options }); | ||
} | ||
} |
Oops, something went wrong.