@mastra/voice-google 0.0.0-trigger-playground-ui-package-20250506151043 → 0.0.0-unified-sidebar-20251010130811
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1690 -0
- package/LICENSE.md +11 -42
- package/README.md +6 -3
- package/dist/index.cjs +52 -17
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +85 -2
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -17
- package/dist/index.js.map +1 -0
- package/package.json +28 -14
- package/dist/_tsup-dts-rollup.d.cts +0 -73
- package/dist/_tsup-dts-rollup.d.ts +0 -73
- package/dist/index.d.cts +0 -2
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { google } from '@google-cloud/text-to-speech/build/protos/protos';
|
|
2
|
-
import type { google as google_2 } from '@google-cloud/speech/build/protos/protos';
|
|
3
|
-
import { MastraVoice } from '@mastra/core/voice';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Configuration for Google Cloud Voice models
|
|
7
|
-
* @interface GoogleModelConfig
|
|
8
|
-
* @property {string} [apiKey] - Optional Google Cloud API key. If not provided, will use GOOGLE_API_KEY environment variable
|
|
9
|
-
*/
|
|
10
|
-
export declare interface GoogleModelConfig {
|
|
11
|
-
apiKey?: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* GoogleVoice class provides Text-to-Speech and Speech-to-Text capabilities using Google Cloud services
|
|
16
|
-
* @class GoogleVoice
|
|
17
|
-
* @extends MastraVoice
|
|
18
|
-
*/
|
|
19
|
-
export declare class GoogleVoice extends MastraVoice {
|
|
20
|
-
private ttsClient;
|
|
21
|
-
private speechClient;
|
|
22
|
-
/**
|
|
23
|
-
* Creates an instance of GoogleVoice
|
|
24
|
-
* @param {Object} config - Configuration options
|
|
25
|
-
* @param {GoogleModelConfig} [config.speechModel] - Configuration for speech synthesis
|
|
26
|
-
* @param {GoogleModelConfig} [config.listeningModel] - Configuration for speech recognition
|
|
27
|
-
* @param {string} [config.speaker] - Default voice ID to use for speech synthesis
|
|
28
|
-
* @throws {Error} If no API key is provided via config or environment variable
|
|
29
|
-
*/
|
|
30
|
-
constructor({ listeningModel, speechModel, speaker, }?: {
|
|
31
|
-
listeningModel?: GoogleModelConfig;
|
|
32
|
-
speechModel?: GoogleModelConfig;
|
|
33
|
-
speaker?: string;
|
|
34
|
-
});
|
|
35
|
-
/**
|
|
36
|
-
* Gets a list of available voices
|
|
37
|
-
* @returns {Promise<Array<{voiceId: string, languageCodes: string[]}>>} List of available voices and their supported languages. Default language is en-US.
|
|
38
|
-
*/
|
|
39
|
-
getSpeakers({ languageCode }?: {
|
|
40
|
-
languageCode?: string;
|
|
41
|
-
}): Promise<{
|
|
42
|
-
voiceId: string;
|
|
43
|
-
languageCodes: string[];
|
|
44
|
-
}[]>;
|
|
45
|
-
private streamToString;
|
|
46
|
-
/**
|
|
47
|
-
* Converts text to speech
|
|
48
|
-
* @param {string | NodeJS.ReadableStream} input - Text or stream to convert to speech
|
|
49
|
-
* @param {Object} [options] - Speech synthesis options
|
|
50
|
-
* @param {string} [options.speaker] - Voice ID to use
|
|
51
|
-
* @param {string} [options.languageCode] - Language code for the voice
|
|
52
|
-
* @param {TextToSpeechTypes.cloud.texttospeech.v1.ISynthesizeSpeechRequest['audioConfig']} [options.audioConfig] - Audio configuration options
|
|
53
|
-
* @returns {Promise<NodeJS.ReadableStream>} Stream of synthesized audio. Default encoding is LINEAR16.
|
|
54
|
-
*/
|
|
55
|
-
speak(input: string | NodeJS.ReadableStream, options?: {
|
|
56
|
-
speaker?: string;
|
|
57
|
-
languageCode?: string;
|
|
58
|
-
audioConfig?: google.cloud.texttospeech.v1.ISynthesizeSpeechRequest['audioConfig'];
|
|
59
|
-
}): Promise<NodeJS.ReadableStream>;
|
|
60
|
-
/**
|
|
61
|
-
* Converts speech to text
|
|
62
|
-
* @param {NodeJS.ReadableStream} audioStream - Audio stream to transcribe. Default encoding is LINEAR16.
|
|
63
|
-
* @param {Object} [options] - Recognition options
|
|
64
|
-
* @param {SpeechTypes.cloud.speech.v1.IRecognitionConfig} [options.config] - Recognition configuration
|
|
65
|
-
* @returns {Promise<string>} Transcribed text
|
|
66
|
-
*/
|
|
67
|
-
listen(audioStream: NodeJS.ReadableStream, options?: {
|
|
68
|
-
stream?: boolean;
|
|
69
|
-
config?: google_2.cloud.speech.v1.IRecognitionConfig;
|
|
70
|
-
}): Promise<string>;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export { }
|
package/dist/index.d.cts
DELETED