@ziplayer/plugin 0.0.4 → 0.1.0
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/dist/SoundCloudPlugin.d.ts +149 -0
- package/dist/SoundCloudPlugin.d.ts.map +1 -1
- package/dist/SoundCloudPlugin.js +149 -0
- package/dist/SoundCloudPlugin.js.map +1 -1
- package/dist/SpotifyPlugin.d.ts +127 -5
- package/dist/SpotifyPlugin.d.ts.map +1 -1
- package/dist/SpotifyPlugin.js +127 -5
- package/dist/SpotifyPlugin.js.map +1 -1
- package/dist/TTSPlugin.d.ts +123 -2
- package/dist/TTSPlugin.d.ts.map +1 -1
- package/dist/TTSPlugin.js +114 -0
- package/dist/TTSPlugin.js.map +1 -1
- package/dist/YouTubePlugin.d.ts +148 -0
- package/dist/YouTubePlugin.d.ts.map +1 -1
- package/dist/YouTubePlugin.js +148 -2
- package/dist/YouTubePlugin.js.map +1 -1
- package/dist/index.d.ts +78 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +78 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/SoundCloudPlugin.ts +149 -0
- package/src/SpotifyPlugin.ts +312 -190
- package/src/TTSPlugin.ts +130 -3
- package/src/YouTubePlugin.ts +528 -382
- package/src/index.ts +82 -0
package/dist/SpotifyPlugin.js
CHANGED
|
@@ -3,11 +3,34 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SpotifyPlugin = void 0;
|
|
4
4
|
const ziplayer_1 = require("ziplayer");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* -
|
|
10
|
-
* -
|
|
6
|
+
* A minimal Spotify plugin for metadata extraction and display purposes.
|
|
7
|
+
*
|
|
8
|
+
* This plugin provides support for:
|
|
9
|
+
* - Spotify track URLs/URIs (spotify:track:...)
|
|
10
|
+
* - Spotify playlist URLs/URIs (spotify:playlist:...)
|
|
11
|
+
* - Spotify album URLs/URIs (spotify:album:...)
|
|
12
|
+
* - Metadata extraction using Spotify's public oEmbed endpoint
|
|
13
|
+
*
|
|
14
|
+
* **Important Notes:**
|
|
15
|
+
* - This plugin does NOT provide audio streams (player is expected to redirect/fallback upstream)
|
|
16
|
+
* - This plugin does NOT expand playlists/albums (no SDK; oEmbed doesn't enumerate items)
|
|
17
|
+
* - This plugin only provides display metadata for Spotify content
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
*
|
|
21
|
+
* const spotifyPlugin = new SpotifyPlugin();
|
|
22
|
+
*
|
|
23
|
+
* // Add to PlayerManager
|
|
24
|
+
* const manager = new PlayerManager({
|
|
25
|
+
* plugins: [spotifyPlugin]
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* // Get metadata for a Spotify track
|
|
29
|
+
* const result = await spotifyPlugin.search("spotify:track:4iV5W9uYEdYUVa79Axb7Rh", "user123");
|
|
30
|
+
* console.log(result.tracks[0].metadata); // Contains Spotify metadata
|
|
31
|
+
*
|
|
32
|
+
*
|
|
33
|
+
* @since 1.1.0
|
|
11
34
|
*/
|
|
12
35
|
class SpotifyPlugin extends ziplayer_1.BasePlugin {
|
|
13
36
|
constructor() {
|
|
@@ -15,6 +38,19 @@ class SpotifyPlugin extends ziplayer_1.BasePlugin {
|
|
|
15
38
|
this.name = "spotify";
|
|
16
39
|
this.version = "1.1.0";
|
|
17
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Determines if this plugin can handle the given query.
|
|
43
|
+
*
|
|
44
|
+
* @param query - The search query or URL to check
|
|
45
|
+
* @returns `true` if the query is a Spotify URL/URI, `false` otherwise
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
*
|
|
49
|
+
* plugin.canHandle("spotify:track:4iV5W9uYEdYUVa79Axb7Rh"); // true
|
|
50
|
+
* plugin.canHandle("https://open.spotify.com/track/4iV5W9uYEdYUVa79Axb7Rh"); // true
|
|
51
|
+
* plugin.canHandle("youtube.com/watch?v=123"); // false
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
18
54
|
canHandle(query) {
|
|
19
55
|
const q = query.toLowerCase().trim();
|
|
20
56
|
if (q.startsWith("spotify:"))
|
|
@@ -27,6 +63,19 @@ class SpotifyPlugin extends ziplayer_1.BasePlugin {
|
|
|
27
63
|
return false;
|
|
28
64
|
}
|
|
29
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Validates if a URL/URI is a valid Spotify URL/URI.
|
|
68
|
+
*
|
|
69
|
+
* @param url - The URL/URI to validate
|
|
70
|
+
* @returns `true` if the URL/URI is a valid Spotify URL/URI, `false` otherwise
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
*
|
|
74
|
+
* plugin.validate("spotify:track:4iV5W9uYEdYUVa79Axb7Rh"); // true
|
|
75
|
+
* plugin.validate("https://open.spotify.com/track/4iV5W9uYEdYUVa79Axb7Rh"); // true
|
|
76
|
+
* plugin.validate("https://youtube.com/watch?v=123"); // false
|
|
77
|
+
*
|
|
78
|
+
*/
|
|
30
79
|
validate(url) {
|
|
31
80
|
if (url.startsWith("spotify:"))
|
|
32
81
|
return true;
|
|
@@ -38,6 +87,28 @@ class SpotifyPlugin extends ziplayer_1.BasePlugin {
|
|
|
38
87
|
return false;
|
|
39
88
|
}
|
|
40
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Extracts metadata from Spotify URLs/URIs using the oEmbed API.
|
|
92
|
+
*
|
|
93
|
+
* This method handles Spotify track, playlist, and album URLs/URIs by fetching
|
|
94
|
+
* display metadata from Spotify's public oEmbed endpoint. It does not provide
|
|
95
|
+
* audio streams or expand playlists/albums.
|
|
96
|
+
*
|
|
97
|
+
* @param query - The Spotify URL/URI to extract metadata from
|
|
98
|
+
* @param requestedBy - The user ID who requested the extraction
|
|
99
|
+
* @returns A SearchResult containing a single track with metadata (no audio stream)
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
*
|
|
103
|
+
* // Extract track metadata
|
|
104
|
+
* const result = await plugin.search("spotify:track:4iV5W9uYEdYUVa79Axb7Rh", "user123");
|
|
105
|
+
* console.log(result.tracks[0].metadata); // Contains Spotify metadata
|
|
106
|
+
*
|
|
107
|
+
* // Extract playlist metadata
|
|
108
|
+
* const playlistResult = await plugin.search("https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M", "user123");
|
|
109
|
+
* console.log(playlistResult.tracks[0].metadata.kind); // "playlist"
|
|
110
|
+
*
|
|
111
|
+
*/
|
|
41
112
|
async search(query, requestedBy) {
|
|
42
113
|
if (!this.validate(query)) {
|
|
43
114
|
return { tracks: [] };
|
|
@@ -57,12 +128,63 @@ class SpotifyPlugin extends ziplayer_1.BasePlugin {
|
|
|
57
128
|
}
|
|
58
129
|
return { tracks: [] };
|
|
59
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* Extracts tracks from a Spotify playlist URL.
|
|
133
|
+
*
|
|
134
|
+
* **Note:** This method is not implemented as this plugin does not support
|
|
135
|
+
* playlist expansion. It always returns an empty array.
|
|
136
|
+
*
|
|
137
|
+
* @param _input - The Spotify playlist URL (unused)
|
|
138
|
+
* @param _requestedBy - The user ID who requested the extraction (unused)
|
|
139
|
+
* @returns An empty array (playlist expansion not supported)
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
*
|
|
143
|
+
* const tracks = await plugin.extractPlaylist("spotify:playlist:123", "user123");
|
|
144
|
+
* console.log(tracks); // [] - empty array
|
|
145
|
+
*
|
|
146
|
+
*/
|
|
60
147
|
async extractPlaylist(_input, _requestedBy) {
|
|
61
148
|
return [];
|
|
62
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Extracts tracks from a Spotify album URL.
|
|
152
|
+
*
|
|
153
|
+
* **Note:** This method is not implemented as this plugin does not support
|
|
154
|
+
* album expansion. It always returns an empty array.
|
|
155
|
+
*
|
|
156
|
+
* @param _input - The Spotify album URL (unused)
|
|
157
|
+
* @param _requestedBy - The user ID who requested the extraction (unused)
|
|
158
|
+
* @returns An empty array (album expansion not supported)
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
*
|
|
162
|
+
* const tracks = await plugin.extractAlbum("spotify:album:123", "user123");
|
|
163
|
+
* console.log(tracks); // [] - empty array
|
|
164
|
+
*
|
|
165
|
+
*/
|
|
63
166
|
async extractAlbum(_input, _requestedBy) {
|
|
64
167
|
return [];
|
|
65
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* Attempts to get an audio stream for a Spotify track.
|
|
171
|
+
*
|
|
172
|
+
* **Note:** This method always throws an error as this plugin does not support
|
|
173
|
+
* audio streaming. The player is expected to redirect to other plugins or
|
|
174
|
+
* use fallback mechanisms for actual audio playback.
|
|
175
|
+
*
|
|
176
|
+
* @param _track - The Track object (unused)
|
|
177
|
+
* @throws {Error} Always throws "Spotify streaming is not supported by this plugin"
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
*
|
|
181
|
+
* try {
|
|
182
|
+
* const stream = await plugin.getStream(track);
|
|
183
|
+
* } catch (error) {
|
|
184
|
+
* console.log(error.message); // "Spotify streaming is not supported by this plugin"
|
|
185
|
+
* }
|
|
186
|
+
*
|
|
187
|
+
*/
|
|
66
188
|
async getStream(_track) {
|
|
67
189
|
throw new Error("Spotify streaming is not supported by this plugin");
|
|
68
190
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpotifyPlugin.js","sourceRoot":"","sources":["../src/SpotifyPlugin.ts"],"names":[],"mappings":";;;AAAA,uCAAuE;AAEvE
|
|
1
|
+
{"version":3,"file":"SpotifyPlugin.js","sourceRoot":"","sources":["../src/SpotifyPlugin.ts"],"names":[],"mappings":";;;AAAA,uCAAuE;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAa,aAAc,SAAQ,qBAAU;IAA7C;;QACC,SAAI,GAAG,SAAS,CAAC;QACjB,YAAO,GAAG,OAAO,CAAC;IAqRnB,CAAC;IA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CAAC,CAAC;QAC1D,OAAO,GAAG,CAAC,IAAI,EAKb,CAAC;IACJ,CAAC;CACD;AAvRD,sCAuRC"}
|
package/dist/TTSPlugin.d.ts
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import { BasePlugin, Track, SearchResult, StreamInfo } from "ziplayer";
|
|
2
2
|
import { Readable } from "stream";
|
|
3
|
+
/**
|
|
4
|
+
* Configuration options for the TTSPlugin.
|
|
5
|
+
*/
|
|
3
6
|
export interface TTSPluginOptions {
|
|
7
|
+
/** Default language code for TTS (e.g., "vi", "en", "en-US") */
|
|
4
8
|
defaultLang?: string;
|
|
9
|
+
/** Whether to use slow speech rate */
|
|
5
10
|
slow?: boolean;
|
|
6
11
|
/**
|
|
7
12
|
* Optional custom TTS hook. If provided, it will be used to
|
|
8
13
|
* create the audio stream for the given text instead of the
|
|
9
14
|
* built-in Google TTS wrapper.
|
|
10
15
|
*
|
|
11
|
-
*
|
|
16
|
+
* @param text - The text to convert to speech
|
|
17
|
+
* @param ctx - Context information including language, speed, and track
|
|
18
|
+
* @returns One of:
|
|
12
19
|
* - Node Readable (preferred)
|
|
13
20
|
* - HTTP(S) URL string or URL object
|
|
14
21
|
* - Buffer / Uint8Array / ArrayBuffer
|
|
15
|
-
|
|
22
|
+
* - Or an object with { stream, type } | { url, type }
|
|
16
23
|
*/
|
|
17
24
|
createStream?: (text: string, ctx?: {
|
|
18
25
|
lang: string;
|
|
@@ -20,13 +27,127 @@ export interface TTSPluginOptions {
|
|
|
20
27
|
track?: Track;
|
|
21
28
|
}) => Promise<Readable | string | URL | Buffer | Uint8Array | ArrayBuffer> | Readable | string | URL | Buffer | Uint8Array | ArrayBuffer;
|
|
22
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* A plugin for Text-to-Speech (TTS) functionality.
|
|
32
|
+
*
|
|
33
|
+
* This plugin provides support for:
|
|
34
|
+
* - Converting text to speech using Google TTS
|
|
35
|
+
* - Custom TTS providers via the createStream hook
|
|
36
|
+
* - Multiple language support
|
|
37
|
+
* - Configurable speech rate (normal/slow)
|
|
38
|
+
* - TTS query parsing with language and speed options
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* const ttsPlugin = new TTSPlugin({
|
|
42
|
+
* defaultLang: "en",
|
|
43
|
+
* slow: false
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* // Add to PlayerManager
|
|
47
|
+
* const manager = new PlayerManager({
|
|
48
|
+
* plugins: [ttsPlugin]
|
|
49
|
+
* });
|
|
50
|
+
*
|
|
51
|
+
* // Search for TTS content
|
|
52
|
+
* const result = await ttsPlugin.search("tts:Hello world", "user123");
|
|
53
|
+
* const stream = await ttsPlugin.getStream(result.tracks[0]);
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* // Custom TTS provider
|
|
57
|
+
* const customTTSPlugin = new TTSPlugin({
|
|
58
|
+
* defaultLang: "en",
|
|
59
|
+
* createStream: async (text, ctx) => {
|
|
60
|
+
* // Custom TTS implementation
|
|
61
|
+
* return customTTSProvider.synthesize(text, ctx.lang);
|
|
62
|
+
* }
|
|
63
|
+
* });
|
|
64
|
+
*
|
|
65
|
+
* @since 1.0.0
|
|
66
|
+
*/
|
|
23
67
|
export declare class TTSPlugin extends BasePlugin {
|
|
24
68
|
name: string;
|
|
25
69
|
version: string;
|
|
26
70
|
private opts;
|
|
71
|
+
/**
|
|
72
|
+
* Creates a new TTSPlugin instance.
|
|
73
|
+
*
|
|
74
|
+
* @param opts - Configuration options for the TTS plugin
|
|
75
|
+
* @param opts.defaultLang - Default language code for TTS (default: "vi")
|
|
76
|
+
* @param opts.slow - Whether to use slow speech rate (default: false)
|
|
77
|
+
* @param opts.createStream - Optional custom TTS provider function
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* // Basic TTS with Vietnamese as default
|
|
81
|
+
* const ttsPlugin = new TTSPlugin();
|
|
82
|
+
*
|
|
83
|
+
* // TTS with English as default and slow speech
|
|
84
|
+
* const slowTTSPlugin = new TTSPlugin({
|
|
85
|
+
* defaultLang: "en",
|
|
86
|
+
* slow: true
|
|
87
|
+
* });
|
|
88
|
+
*
|
|
89
|
+
* // TTS with custom provider
|
|
90
|
+
* const customTTSPlugin = new TTSPlugin({
|
|
91
|
+
* defaultLang: "en",
|
|
92
|
+
* createStream: async (text, ctx) => {
|
|
93
|
+
* return await myCustomTTS.synthesize(text, ctx.lang);
|
|
94
|
+
* }
|
|
95
|
+
* });
|
|
96
|
+
*/
|
|
27
97
|
constructor(opts?: TTSPluginOptions);
|
|
98
|
+
/**
|
|
99
|
+
* Determines if this plugin can handle the given query.
|
|
100
|
+
*
|
|
101
|
+
* @param query - The search query to check
|
|
102
|
+
* @returns `true` if the query starts with "tts:" or "say ", `false` otherwise
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* plugin.canHandle("tts:Hello world"); // true
|
|
106
|
+
* plugin.canHandle("say Hello world"); // true
|
|
107
|
+
* plugin.canHandle("youtube.com/watch?v=123"); // false
|
|
108
|
+
*/
|
|
28
109
|
canHandle(query: string): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Creates a TTS track from the given query.
|
|
112
|
+
*
|
|
113
|
+
* This method parses TTS queries and creates a track that can be played as audio.
|
|
114
|
+
* It supports various query formats including language and speed specifications.
|
|
115
|
+
*
|
|
116
|
+
* @param query - The TTS query to process
|
|
117
|
+
* @param requestedBy - The user ID who requested the TTS
|
|
118
|
+
* @returns A SearchResult containing a single TTS track
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* // Basic TTS
|
|
122
|
+
* const result = await plugin.search("tts:Hello world", "user123");
|
|
123
|
+
*
|
|
124
|
+
* // TTS with specific language
|
|
125
|
+
* const result2 = await plugin.search("tts:en:Hello world", "user123");
|
|
126
|
+
*
|
|
127
|
+
* // TTS with language and slow speed
|
|
128
|
+
* const result3 = await plugin.search("tts:en:true:Hello world", "user123");
|
|
129
|
+
*
|
|
130
|
+
* // Using "say" prefix
|
|
131
|
+
* const result4 = await plugin.search("say Hello world", "user123");
|
|
132
|
+
*/
|
|
29
133
|
search(query: string, requestedBy: string): Promise<SearchResult>;
|
|
134
|
+
/**
|
|
135
|
+
* Generates an audio stream for a TTS track.
|
|
136
|
+
*
|
|
137
|
+
* This method converts the text in the track to speech using either the custom
|
|
138
|
+
* TTS provider (if configured) or the built-in Google TTS service. It handles
|
|
139
|
+
* various return types from custom providers and ensures proper stream formatting.
|
|
140
|
+
*
|
|
141
|
+
* @param track - The TTS track to convert to audio
|
|
142
|
+
* @returns A StreamInfo object containing the audio stream
|
|
143
|
+
* @throws {Error} If TTS generation fails or no audio URLs are returned
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* const track = { id: "tts-123", title: "TTS: Hello world", ... };
|
|
147
|
+
* const streamInfo = await plugin.getStream(track);
|
|
148
|
+
* console.log(streamInfo.type); // "arbitrary"
|
|
149
|
+
* console.log(streamInfo.stream); // Readable stream with audio
|
|
150
|
+
*/
|
|
30
151
|
getStream(track: Track): Promise<StreamInfo>;
|
|
31
152
|
private toReadable;
|
|
32
153
|
private parseQuery;
|
package/dist/TTSPlugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TTSPlugin.d.ts","sourceRoot":"","sources":["../src/TTSPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAIlC,MAAM,WAAW,gBAAgB;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf
|
|
1
|
+
{"version":3,"file":"TTSPlugin.d.ts","sourceRoot":"","sources":["../src/TTSPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,M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@@ -8,7 +8,70 @@ const ziplayer_1 = require("ziplayer");
|
|
|
8
8
|
const stream_1 = require("stream");
|
|
9
9
|
const zitts_1 = require("@zibot/zitts");
|
|
10
10
|
const axios_1 = __importDefault(require("axios"));
|
|
11
|
+
/**
|
|
12
|
+
* A plugin for Text-to-Speech (TTS) functionality.
|
|
13
|
+
*
|
|
14
|
+
* This plugin provides support for:
|
|
15
|
+
* - Converting text to speech using Google TTS
|
|
16
|
+
* - Custom TTS providers via the createStream hook
|
|
17
|
+
* - Multiple language support
|
|
18
|
+
* - Configurable speech rate (normal/slow)
|
|
19
|
+
* - TTS query parsing with language and speed options
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* const ttsPlugin = new TTSPlugin({
|
|
23
|
+
* defaultLang: "en",
|
|
24
|
+
* slow: false
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* // Add to PlayerManager
|
|
28
|
+
* const manager = new PlayerManager({
|
|
29
|
+
* plugins: [ttsPlugin]
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* // Search for TTS content
|
|
33
|
+
* const result = await ttsPlugin.search("tts:Hello world", "user123");
|
|
34
|
+
* const stream = await ttsPlugin.getStream(result.tracks[0]);
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* // Custom TTS provider
|
|
38
|
+
* const customTTSPlugin = new TTSPlugin({
|
|
39
|
+
* defaultLang: "en",
|
|
40
|
+
* createStream: async (text, ctx) => {
|
|
41
|
+
* // Custom TTS implementation
|
|
42
|
+
* return customTTSProvider.synthesize(text, ctx.lang);
|
|
43
|
+
* }
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* @since 1.0.0
|
|
47
|
+
*/
|
|
11
48
|
class TTSPlugin extends ziplayer_1.BasePlugin {
|
|
49
|
+
/**
|
|
50
|
+
* Creates a new TTSPlugin instance.
|
|
51
|
+
*
|
|
52
|
+
* @param opts - Configuration options for the TTS plugin
|
|
53
|
+
* @param opts.defaultLang - Default language code for TTS (default: "vi")
|
|
54
|
+
* @param opts.slow - Whether to use slow speech rate (default: false)
|
|
55
|
+
* @param opts.createStream - Optional custom TTS provider function
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* // Basic TTS with Vietnamese as default
|
|
59
|
+
* const ttsPlugin = new TTSPlugin();
|
|
60
|
+
*
|
|
61
|
+
* // TTS with English as default and slow speech
|
|
62
|
+
* const slowTTSPlugin = new TTSPlugin({
|
|
63
|
+
* defaultLang: "en",
|
|
64
|
+
* slow: true
|
|
65
|
+
* });
|
|
66
|
+
*
|
|
67
|
+
* // TTS with custom provider
|
|
68
|
+
* const customTTSPlugin = new TTSPlugin({
|
|
69
|
+
* defaultLang: "en",
|
|
70
|
+
* createStream: async (text, ctx) => {
|
|
71
|
+
* return await myCustomTTS.synthesize(text, ctx.lang);
|
|
72
|
+
* }
|
|
73
|
+
* });
|
|
74
|
+
*/
|
|
12
75
|
constructor(opts) {
|
|
13
76
|
super();
|
|
14
77
|
this.name = "tts";
|
|
@@ -19,12 +82,46 @@ class TTSPlugin extends ziplayer_1.BasePlugin {
|
|
|
19
82
|
createStream: opts?.createStream,
|
|
20
83
|
};
|
|
21
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Determines if this plugin can handle the given query.
|
|
87
|
+
*
|
|
88
|
+
* @param query - The search query to check
|
|
89
|
+
* @returns `true` if the query starts with "tts:" or "say ", `false` otherwise
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* plugin.canHandle("tts:Hello world"); // true
|
|
93
|
+
* plugin.canHandle("say Hello world"); // true
|
|
94
|
+
* plugin.canHandle("youtube.com/watch?v=123"); // false
|
|
95
|
+
*/
|
|
22
96
|
canHandle(query) {
|
|
23
97
|
if (!query)
|
|
24
98
|
return false;
|
|
25
99
|
const q = query.trim().toLowerCase();
|
|
26
100
|
return q.startsWith("tts:") || q.startsWith("say ");
|
|
27
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Creates a TTS track from the given query.
|
|
104
|
+
*
|
|
105
|
+
* This method parses TTS queries and creates a track that can be played as audio.
|
|
106
|
+
* It supports various query formats including language and speed specifications.
|
|
107
|
+
*
|
|
108
|
+
* @param query - The TTS query to process
|
|
109
|
+
* @param requestedBy - The user ID who requested the TTS
|
|
110
|
+
* @returns A SearchResult containing a single TTS track
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* // Basic TTS
|
|
114
|
+
* const result = await plugin.search("tts:Hello world", "user123");
|
|
115
|
+
*
|
|
116
|
+
* // TTS with specific language
|
|
117
|
+
* const result2 = await plugin.search("tts:en:Hello world", "user123");
|
|
118
|
+
*
|
|
119
|
+
* // TTS with language and slow speed
|
|
120
|
+
* const result3 = await plugin.search("tts:en:true:Hello world", "user123");
|
|
121
|
+
*
|
|
122
|
+
* // Using "say" prefix
|
|
123
|
+
* const result4 = await plugin.search("say Hello world", "user123");
|
|
124
|
+
*/
|
|
28
125
|
async search(query, requestedBy) {
|
|
29
126
|
if (!this.canHandle(query)) {
|
|
30
127
|
return { tracks: [] };
|
|
@@ -45,6 +142,23 @@ class TTSPlugin extends ziplayer_1.BasePlugin {
|
|
|
45
142
|
};
|
|
46
143
|
return { tracks: [track] };
|
|
47
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Generates an audio stream for a TTS track.
|
|
147
|
+
*
|
|
148
|
+
* This method converts the text in the track to speech using either the custom
|
|
149
|
+
* TTS provider (if configured) or the built-in Google TTS service. It handles
|
|
150
|
+
* various return types from custom providers and ensures proper stream formatting.
|
|
151
|
+
*
|
|
152
|
+
* @param track - The TTS track to convert to audio
|
|
153
|
+
* @returns A StreamInfo object containing the audio stream
|
|
154
|
+
* @throws {Error} If TTS generation fails or no audio URLs are returned
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* const track = { id: "tts-123", title: "TTS: Hello world", ... };
|
|
158
|
+
* const streamInfo = await plugin.getStream(track);
|
|
159
|
+
* console.log(streamInfo.type); // "arbitrary"
|
|
160
|
+
* console.log(streamInfo.stream); // Readable stream with audio
|
|
161
|
+
*/
|
|
48
162
|
async getStream(track) {
|
|
49
163
|
const cfg = this.extractConfig(track);
|
|
50
164
|
if (this.opts.createStream && typeof this.opts.createStream === "function") {
|
package/dist/TTSPlugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TTSPlugin.js","sourceRoot":"","sources":["../src/TTSPlugin.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAuE;AACvE,mCAAkC;AAClC,wCAA0C;AAC1C,kDAA0B;
|
|
1
|
+
{"version":3,"file":"TTSPlugin.js","sourceRoot":"","sources":["../src/TTSPlugin.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAuE;AACvE,mCAAkC;AAClC,wCAA0C;AAC1C,kDAA0B;AAgD1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAa,SAAU,SAAQ,qBAAU;IAKxC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,YAAY,IAAuB;QAClC,KAAK,EAAE,CAAC;QA/BT,SAAI,GAAG,KAAK,CAAC;QACb,YAAO,GAAG,OAAO,CAAC;QA+BjB,IAAI,CAAC,IAAI,GAAG;YACX,WAAW,EAAE,IAAI,EAAE,WAAW,IAAI,IAAI;YACtC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI;YAClB,YAAY,EAAE,IAAI,EAAE,YAAY;SAChC,CAAC;IACH,CAAC;IAED;;;;;;;;;;OAUG;IACH,SAAS,CAAC,KAAa;QACtB,IAAI,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QACzB,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QACrC,OAAO,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;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