File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed
Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -418,7 +418,35 @@ export const VOICES = Object.freeze({
418418 // },
419419} ) ;
420420
421- const VOICE_DATA_URL = "https://huggingface.co/onnx-community/Kokoro-82M-v1.0-ONNX/resolve/main/voices" ;
421+
422+ /**
423+ * The base URL for fetching voice data files.
424+ */
425+ let voiceDataUrl = "https://huggingface.co/onnx-community/Kokoro-82M-v1.0-ONNX/resolve/main/voices" ;
426+
427+
428+ /**
429+ * Retrieves the current voice data URL.
430+ *
431+ * @returns The current voice data URL.
432+ */
433+ export function getVoiceDataUrl ( ) {
434+ return voiceDataUrl ;
435+ } ;
436+
437+ /**
438+ * Sets a new voice data URL.
439+ *
440+ * @param url - The new URL to set for voice data.
441+ * @throws Will throw an error if the URL is not a valid non-empty string.
442+ */
443+ export function setVoiceDataUrl ( url ) {
444+ if ( typeof url === 'string' && url . trim ( ) !== '' ) {
445+ voiceDataUrl = url ;
446+ } else {
447+ throw new Error ( "Invalid URL" ) ;
448+ }
449+ } ;
422450
423451/**
424452 *
You can’t perform that action at this time.
0 commit comments