@cartesia/cartesia-js 1.2.2-alpha.0 → 2.0.0-alpha
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/Client.d.ts +40 -0
- package/Client.js +32 -0
- package/README.md +170 -193
- package/api/index.d.ts +1 -0
- package/api/index.js +17 -0
- package/api/resources/apiStatus/client/Client.d.ts +39 -0
- package/api/resources/apiStatus/client/Client.js +103 -0
- package/api/resources/apiStatus/client/index.d.ts +1 -0
- package/api/resources/apiStatus/client/index.js +2 -0
- package/api/resources/apiStatus/index.d.ts +2 -0
- package/api/resources/apiStatus/index.js +18 -0
- package/api/resources/apiStatus/types/ApiInfo.d.ts +7 -0
- package/api/resources/apiStatus/types/ApiInfo.js +5 -0
- package/api/resources/apiStatus/types/index.d.ts +1 -0
- package/api/resources/apiStatus/types/index.js +17 -0
- package/api/resources/embedding/index.d.ts +1 -0
- package/api/resources/embedding/index.js +17 -0
- package/api/resources/embedding/types/Embedding.d.ts +10 -0
- package/api/resources/embedding/types/Embedding.js +5 -0
- package/api/resources/embedding/types/index.d.ts +1 -0
- package/api/resources/embedding/types/index.js +17 -0
- package/api/resources/index.d.ts +12 -0
- package/api/resources/index.js +41 -0
- package/api/resources/tts/client/Client.d.ts +36 -0
- package/api/resources/tts/client/Client.js +152 -0
- package/api/resources/tts/client/index.d.ts +1 -0
- package/api/resources/tts/client/index.js +2 -0
- package/api/resources/tts/index.d.ts +2 -0
- package/api/resources/tts/index.js +18 -0
- package/api/resources/tts/types/CancelContextRequest.d.ts +10 -0
- package/api/resources/tts/types/CancelContextRequest.js +5 -0
- package/api/resources/tts/types/ContextId.d.ts +9 -0
- package/api/resources/tts/types/ContextId.js +5 -0
- package/api/resources/tts/types/Controls.d.ts +8 -0
- package/api/resources/tts/types/Controls.js +5 -0
- package/api/resources/tts/types/Emotion.d.ts +33 -0
- package/api/resources/tts/types/Emotion.js +28 -0
- package/api/resources/tts/types/GenerationRequest.d.ts +25 -0
- package/api/resources/tts/types/GenerationRequest.js +5 -0
- package/api/resources/tts/types/Mp3OutputFormat.d.ts +7 -0
- package/api/resources/tts/types/Mp3OutputFormat.js +5 -0
- package/api/resources/tts/types/NaturalSpecifier.d.ts +11 -0
- package/api/resources/tts/types/NaturalSpecifier.js +13 -0
- package/api/resources/tts/types/NumericalSpecifier.d.ts +4 -0
- package/api/resources/tts/types/NumericalSpecifier.js +5 -0
- package/api/resources/tts/types/OutputFormat.d.ts +16 -0
- package/api/resources/tts/types/OutputFormat.js +5 -0
- package/api/resources/tts/types/RawEncoding.d.ts +10 -0
- package/api/resources/tts/types/RawEncoding.js +12 -0
- package/api/resources/tts/types/RawOutputFormat.d.ts +8 -0
- package/api/resources/tts/types/RawOutputFormat.js +5 -0
- package/api/resources/tts/types/Speed.d.ts +10 -0
- package/api/resources/tts/types/Speed.js +5 -0
- package/api/resources/tts/types/SupportedLanguage.d.ts +26 -0
- package/api/resources/tts/types/SupportedLanguage.js +23 -0
- package/api/resources/tts/types/TtsRequest.d.ts +17 -0
- package/api/resources/tts/types/TtsRequest.js +5 -0
- package/api/resources/tts/types/TtsRequestEmbeddingSpecifier.d.ts +9 -0
- package/api/resources/tts/types/TtsRequestEmbeddingSpecifier.js +5 -0
- package/api/resources/tts/types/TtsRequestIdSpecifier.d.ts +9 -0
- package/api/resources/tts/types/TtsRequestIdSpecifier.js +5 -0
- package/api/resources/tts/types/TtsRequestVoiceSpecifier.d.ts +5 -0
- package/api/resources/tts/types/TtsRequestVoiceSpecifier.js +5 -0
- package/api/resources/tts/types/WavOutputFormat.d.ts +6 -0
- package/api/resources/tts/types/WavOutputFormat.js +5 -0
- package/api/resources/tts/types/WebSocketBaseResponse.d.ts +9 -0
- package/api/resources/tts/types/WebSocketBaseResponse.js +5 -0
- package/api/resources/tts/types/WebSocketChunkResponse.d.ts +8 -0
- package/api/resources/tts/types/WebSocketChunkResponse.js +5 -0
- package/api/resources/tts/types/WebSocketDoneResponse.d.ts +6 -0
- package/api/resources/tts/types/WebSocketDoneResponse.js +5 -0
- package/api/resources/tts/types/WebSocketErrorResponse.d.ts +7 -0
- package/api/resources/tts/types/WebSocketErrorResponse.js +5 -0
- package/api/resources/tts/types/WebSocketRawOutputFormat.d.ts +9 -0
- package/api/resources/tts/types/WebSocketRawOutputFormat.js +5 -0
- package/api/resources/tts/types/WebSocketRequest.d.ts +13 -0
- package/api/resources/tts/types/WebSocketRequest.js +5 -0
- package/api/resources/tts/types/WebSocketResponse.d.ts +19 -0
- package/api/resources/tts/types/WebSocketResponse.js +5 -0
- package/api/resources/tts/types/WebSocketStreamOptions.d.ts +6 -0
- package/api/resources/tts/types/WebSocketStreamOptions.js +5 -0
- package/api/resources/tts/types/WebSocketTimestampsResponse.d.ts +7 -0
- package/api/resources/tts/types/WebSocketTimestampsResponse.js +5 -0
- package/api/resources/tts/types/WebSocketTtsOutput.d.ts +9 -0
- package/api/resources/tts/types/WebSocketTtsOutput.js +5 -0
- package/api/resources/tts/types/WebSocketTtsRequest.d.ts +15 -0
- package/api/resources/tts/types/WebSocketTtsRequest.js +5 -0
- package/api/resources/tts/types/WordTimestamps.d.ts +8 -0
- package/api/resources/tts/types/WordTimestamps.js +5 -0
- package/api/resources/tts/types/index.d.ts +30 -0
- package/api/resources/tts/types/index.js +46 -0
- package/api/resources/voiceChanger/client/Client.d.ts +43 -0
- package/api/resources/voiceChanger/client/Client.js +181 -0
- package/api/resources/voiceChanger/client/index.d.ts +1 -0
- package/api/resources/voiceChanger/client/index.js +17 -0
- package/api/resources/voiceChanger/client/requests/VoiceChangerBytesRequest.d.ts +44 -0
- package/api/resources/voiceChanger/client/requests/VoiceChangerBytesRequest.js +5 -0
- package/api/resources/voiceChanger/client/requests/VoiceChangerSseRequest.d.ts +44 -0
- package/api/resources/voiceChanger/client/requests/VoiceChangerSseRequest.js +5 -0
- package/api/resources/voiceChanger/client/requests/index.d.ts +2 -0
- package/api/resources/voiceChanger/client/requests/index.js +2 -0
- package/api/resources/voiceChanger/index.d.ts +2 -0
- package/api/resources/voiceChanger/index.js +18 -0
- package/api/resources/voiceChanger/types/OutputFormatContainer.d.ts +9 -0
- package/api/resources/voiceChanger/types/OutputFormatContainer.js +11 -0
- package/api/resources/voiceChanger/types/StreamingResponse.d.ts +16 -0
- package/api/resources/voiceChanger/types/StreamingResponse.js +5 -0
- package/api/resources/voiceChanger/types/index.d.ts +2 -0
- package/api/resources/voiceChanger/types/index.js +18 -0
- package/api/resources/voices/client/Client.d.ts +141 -0
- package/api/resources/voices/client/Client.js +512 -0
- package/api/resources/voices/client/index.d.ts +1 -0
- package/api/resources/voices/client/index.js +17 -0
- package/api/resources/voices/client/requests/CloneVoiceRequest.d.ts +56 -0
- package/api/resources/voices/client/requests/CloneVoiceRequest.js +5 -0
- package/api/resources/voices/client/requests/index.d.ts +1 -0
- package/api/resources/voices/client/requests/index.js +2 -0
- package/api/resources/voices/index.d.ts +2 -0
- package/api/resources/voices/index.js +18 -0
- package/api/resources/voices/types/BaseVoiceId.d.ts +8 -0
- package/api/resources/voices/types/BaseVoiceId.js +5 -0
- package/api/resources/voices/types/CloneMode.d.ts +8 -0
- package/api/resources/voices/types/CloneMode.js +10 -0
- package/api/resources/voices/types/CreateVoiceRequest.d.ts +13 -0
- package/api/resources/voices/types/CreateVoiceRequest.js +5 -0
- package/api/resources/voices/types/EmbeddingResponse.d.ts +7 -0
- package/api/resources/voices/types/EmbeddingResponse.js +5 -0
- package/api/resources/voices/types/EmbeddingSpecifier.d.ts +8 -0
- package/api/resources/voices/types/EmbeddingSpecifier.js +5 -0
- package/api/resources/voices/types/Gender.d.ts +8 -0
- package/api/resources/voices/types/Gender.js +10 -0
- package/api/resources/voices/types/IdSpecifier.d.ts +8 -0
- package/api/resources/voices/types/IdSpecifier.js +5 -0
- package/api/resources/voices/types/LocalizeDialect.d.ts +16 -0
- package/api/resources/voices/types/LocalizeDialect.js +13 -0
- package/api/resources/voices/types/LocalizeTargetLanguage.d.ts +26 -0
- package/api/resources/voices/types/LocalizeTargetLanguage.js +23 -0
- package/api/resources/voices/types/LocalizeVoiceRequest.d.ts +10 -0
- package/api/resources/voices/types/LocalizeVoiceRequest.js +5 -0
- package/api/resources/voices/types/MixVoiceSpecifier.d.ts +5 -0
- package/api/resources/voices/types/MixVoiceSpecifier.js +5 -0
- package/api/resources/voices/types/MixVoicesRequest.d.ts +7 -0
- package/api/resources/voices/types/MixVoicesRequest.js +5 -0
- package/api/resources/voices/types/UpdateVoiceRequest.d.ts +9 -0
- package/api/resources/voices/types/UpdateVoiceRequest.js +5 -0
- package/api/resources/voices/types/Voice.d.ts +20 -0
- package/api/resources/voices/types/Voice.js +5 -0
- package/api/resources/voices/types/VoiceId.d.ts +7 -0
- package/api/resources/voices/types/VoiceId.js +5 -0
- package/api/resources/voices/types/VoiceMetadata.d.ts +18 -0
- package/api/resources/voices/types/VoiceMetadata.js +5 -0
- package/api/resources/voices/types/Weight.d.ts +7 -0
- package/api/resources/voices/types/Weight.js +5 -0
- package/api/resources/voices/types/index.d.ts +17 -0
- package/api/resources/voices/types/index.js +33 -0
- package/core/fetcher/APIResponse.d.ts +10 -0
- package/core/fetcher/APIResponse.js +2 -0
- package/core/fetcher/Fetcher.d.ts +39 -0
- package/core/fetcher/Fetcher.js +99 -0
- package/core/fetcher/Supplier.d.ts +4 -0
- package/core/fetcher/Supplier.js +22 -0
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +13 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +59 -0
- package/core/fetcher/getHeader.d.ts +1 -0
- package/core/fetcher/getHeader.js +12 -0
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +23 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +52 -0
- package/core/fetcher/index.d.ts +5 -0
- package/core/fetcher/index.js +9 -0
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +42 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +41 -0
- package/core/fetcher/signals.d.ts +12 -0
- package/core/fetcher/signals.js +37 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +50 -0
- package/core/form-data-utils/FormDataWrapper.d.ts +60 -0
- package/core/form-data-utils/FormDataWrapper.js +174 -0
- package/core/form-data-utils/index.d.ts +1 -0
- package/core/form-data-utils/index.js +17 -0
- package/core/index.d.ts +5 -0
- package/core/index.js +34 -0
- package/core/runtime/index.d.ts +1 -0
- package/core/runtime/index.js +5 -0
- package/core/runtime/runtime.d.ts +9 -0
- package/core/runtime/runtime.js +93 -0
- package/core/schemas/Schema.d.ts +85 -0
- package/core/schemas/Schema.js +22 -0
- package/core/schemas/builders/bigint/bigint.d.ts +2 -0
- package/core/schemas/builders/bigint/bigint.js +50 -0
- package/core/schemas/builders/bigint/index.d.ts +1 -0
- package/core/schemas/builders/bigint/index.js +5 -0
- package/core/schemas/builders/date/date.d.ts +2 -0
- package/core/schemas/builders/date/date.js +63 -0
- package/core/schemas/builders/date/index.d.ts +1 -0
- package/core/schemas/builders/date/index.js +5 -0
- package/core/schemas/builders/enum/enum.d.ts +2 -0
- package/core/schemas/builders/enum/enum.js +39 -0
- package/core/schemas/builders/enum/index.d.ts +1 -0
- package/core/schemas/builders/enum/index.js +5 -0
- package/core/schemas/builders/index.d.ts +14 -0
- package/core/schemas/builders/index.js +30 -0
- package/core/schemas/builders/lazy/index.d.ts +3 -0
- package/core/schemas/builders/lazy/index.js +7 -0
- package/core/schemas/builders/lazy/lazy.d.ts +5 -0
- package/core/schemas/builders/lazy/lazy.js +25 -0
- package/core/schemas/builders/lazy/lazyObject.d.ts +3 -0
- package/core/schemas/builders/lazy/lazyObject.js +12 -0
- package/core/schemas/builders/list/index.d.ts +1 -0
- package/core/schemas/builders/list/index.js +5 -0
- package/core/schemas/builders/list/list.d.ts +2 -0
- package/core/schemas/builders/list/list.js +55 -0
- package/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
- package/core/schemas/builders/literals/booleanLiteral.js +29 -0
- package/core/schemas/builders/literals/index.d.ts +2 -0
- package/core/schemas/builders/literals/index.js +7 -0
- package/core/schemas/builders/literals/stringLiteral.d.ts +2 -0
- package/core/schemas/builders/literals/stringLiteral.js +29 -0
- package/core/schemas/builders/object/index.d.ts +6 -0
- package/core/schemas/builders/object/index.js +11 -0
- package/core/schemas/builders/object/object.d.ts +3 -0
- package/core/schemas/builders/object/object.js +233 -0
- package/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
- package/core/schemas/builders/object/objectWithoutOptionalProperties.js +8 -0
- package/core/schemas/builders/object/property.d.ts +8 -0
- package/core/schemas/builders/object/property.js +16 -0
- package/core/schemas/builders/object/types.d.ts +26 -0
- package/core/schemas/builders/object/types.js +2 -0
- package/core/schemas/builders/object-like/getObjectLikeUtils.d.ts +9 -0
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +54 -0
- package/core/schemas/builders/object-like/index.d.ts +2 -0
- package/core/schemas/builders/object-like/index.js +6 -0
- package/core/schemas/builders/object-like/types.d.ts +7 -0
- package/core/schemas/builders/object-like/types.js +2 -0
- package/core/schemas/builders/primitives/any.d.ts +1 -0
- package/core/schemas/builders/primitives/any.js +6 -0
- package/core/schemas/builders/primitives/boolean.d.ts +1 -0
- package/core/schemas/builders/primitives/boolean.js +25 -0
- package/core/schemas/builders/primitives/index.d.ts +5 -0
- package/core/schemas/builders/primitives/index.js +13 -0
- package/core/schemas/builders/primitives/number.d.ts +1 -0
- package/core/schemas/builders/primitives/number.js +25 -0
- package/core/schemas/builders/primitives/string.d.ts +1 -0
- package/core/schemas/builders/primitives/string.js +25 -0
- package/core/schemas/builders/primitives/unknown.d.ts +1 -0
- package/core/schemas/builders/primitives/unknown.js +6 -0
- package/core/schemas/builders/record/index.d.ts +2 -0
- package/core/schemas/builders/record/index.js +5 -0
- package/core/schemas/builders/record/record.d.ts +3 -0
- package/core/schemas/builders/record/record.js +95 -0
- package/core/schemas/builders/record/types.d.ts +4 -0
- package/core/schemas/builders/record/types.js +2 -0
- package/core/schemas/builders/schema-utils/JsonError.d.ts +5 -0
- package/core/schemas/builders/schema-utils/JsonError.js +12 -0
- package/core/schemas/builders/schema-utils/ParseError.d.ts +5 -0
- package/core/schemas/builders/schema-utils/ParseError.js +12 -0
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +17 -0
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +82 -0
- package/core/schemas/builders/schema-utils/index.d.ts +4 -0
- package/core/schemas/builders/schema-utils/index.js +11 -0
- package/core/schemas/builders/schema-utils/stringifyValidationErrors.d.ts +2 -0
- package/core/schemas/builders/schema-utils/stringifyValidationErrors.js +10 -0
- package/core/schemas/builders/set/index.d.ts +1 -0
- package/core/schemas/builders/set/index.js +5 -0
- package/core/schemas/builders/set/set.d.ts +2 -0
- package/core/schemas/builders/set/set.js +44 -0
- package/core/schemas/builders/undiscriminated-union/index.d.ts +2 -0
- package/core/schemas/builders/undiscriminated-union/index.js +5 -0
- package/core/schemas/builders/undiscriminated-union/types.d.ts +4 -0
- package/core/schemas/builders/undiscriminated-union/types.js +2 -0
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.d.ts +3 -0
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +40 -0
- package/core/schemas/builders/union/discriminant.d.ts +5 -0
- package/core/schemas/builders/union/discriminant.js +10 -0
- package/core/schemas/builders/union/index.d.ts +4 -0
- package/core/schemas/builders/union/index.js +7 -0
- package/core/schemas/builders/union/types.d.ts +13 -0
- package/core/schemas/builders/union/types.js +2 -0
- package/core/schemas/builders/union/union.d.ts +4 -0
- package/core/schemas/builders/union/union.js +130 -0
- package/core/schemas/index.d.ts +2 -0
- package/core/schemas/index.js +17 -0
- package/core/schemas/utils/MaybePromise.d.ts +1 -0
- package/core/schemas/utils/MaybePromise.js +2 -0
- package/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +7 -0
- package/core/schemas/utils/addQuestionMarksToNullableProperties.js +2 -0
- package/core/schemas/utils/createIdentitySchemaCreator.d.ts +2 -0
- package/core/schemas/utils/createIdentitySchemaCreator.js +16 -0
- package/core/schemas/utils/entries.d.ts +1 -0
- package/core/schemas/utils/entries.js +7 -0
- package/core/schemas/utils/filterObject.d.ts +1 -0
- package/core/schemas/utils/filterObject.js +14 -0
- package/core/schemas/utils/getErrorMessageForIncorrectType.d.ts +1 -0
- package/core/schemas/utils/getErrorMessageForIncorrectType.js +28 -0
- package/core/schemas/utils/isPlainObject.d.ts +1 -0
- package/core/schemas/utils/isPlainObject.js +18 -0
- package/core/schemas/utils/keys.d.ts +1 -0
- package/core/schemas/utils/keys.js +7 -0
- package/core/schemas/utils/maybeSkipValidation.d.ts +2 -0
- package/core/schemas/utils/maybeSkipValidation.js +28 -0
- package/core/schemas/utils/partition.d.ts +1 -0
- package/core/schemas/utils/partition.js +16 -0
- package/core/streaming-fetcher/Stream.d.ts +48 -0
- package/core/streaming-fetcher/Stream.js +170 -0
- package/core/streaming-fetcher/index.d.ts +1 -0
- package/core/streaming-fetcher/index.js +5 -0
- package/core/websocket/events.d.ts +36 -0
- package/core/websocket/events.js +27 -0
- package/core/websocket/index.d.ts +1 -0
- package/core/websocket/index.js +17 -0
- package/core/websocket/ws.d.ts +136 -0
- package/core/websocket/ws.js +438 -0
- package/dist/Client.d.ts +40 -0
- package/dist/Client.js +32 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +17 -0
- package/dist/api/resources/apiStatus/client/Client.d.ts +39 -0
- package/dist/api/resources/apiStatus/client/Client.js +103 -0
- package/dist/api/resources/apiStatus/client/index.d.ts +1 -0
- package/dist/api/resources/apiStatus/client/index.js +2 -0
- package/dist/api/resources/apiStatus/index.d.ts +2 -0
- package/dist/api/resources/apiStatus/index.js +18 -0
- package/dist/api/resources/apiStatus/types/ApiInfo.d.ts +7 -0
- package/dist/api/resources/apiStatus/types/ApiInfo.js +5 -0
- package/dist/api/resources/apiStatus/types/index.d.ts +1 -0
- package/dist/api/resources/apiStatus/types/index.js +17 -0
- package/dist/api/resources/embedding/index.d.ts +1 -0
- package/dist/api/resources/embedding/index.js +17 -0
- package/dist/api/resources/embedding/types/Embedding.d.ts +10 -0
- package/dist/api/resources/embedding/types/Embedding.js +5 -0
- package/dist/api/resources/embedding/types/index.d.ts +1 -0
- package/dist/api/resources/embedding/types/index.js +17 -0
- package/dist/api/resources/index.d.ts +12 -0
- package/dist/api/resources/index.js +41 -0
- package/dist/api/resources/tts/client/Client.d.ts +36 -0
- package/dist/api/resources/tts/client/Client.js +152 -0
- package/dist/api/resources/tts/client/index.d.ts +1 -0
- package/dist/api/resources/tts/client/index.js +2 -0
- package/dist/api/resources/tts/index.d.ts +2 -0
- package/dist/api/resources/tts/index.js +18 -0
- package/dist/api/resources/tts/types/CancelContextRequest.d.ts +10 -0
- package/dist/api/resources/tts/types/CancelContextRequest.js +5 -0
- package/dist/api/resources/tts/types/ContextId.d.ts +9 -0
- package/dist/api/resources/tts/types/ContextId.js +5 -0
- package/dist/api/resources/tts/types/Controls.d.ts +8 -0
- package/dist/api/resources/tts/types/Controls.js +5 -0
- package/dist/api/resources/tts/types/Emotion.d.ts +33 -0
- package/dist/api/resources/tts/types/Emotion.js +28 -0
- package/dist/api/resources/tts/types/GenerationRequest.d.ts +25 -0
- package/dist/api/resources/tts/types/GenerationRequest.js +5 -0
- package/dist/api/resources/tts/types/Mp3OutputFormat.d.ts +7 -0
- package/dist/api/resources/tts/types/Mp3OutputFormat.js +5 -0
- package/dist/api/resources/tts/types/NaturalSpecifier.d.ts +11 -0
- package/dist/api/resources/tts/types/NaturalSpecifier.js +13 -0
- package/dist/api/resources/tts/types/NumericalSpecifier.d.ts +4 -0
- package/dist/api/resources/tts/types/NumericalSpecifier.js +5 -0
- package/dist/api/resources/tts/types/OutputFormat.d.ts +16 -0
- package/dist/api/resources/tts/types/OutputFormat.js +5 -0
- package/dist/api/resources/tts/types/RawEncoding.d.ts +10 -0
- package/dist/api/resources/tts/types/RawEncoding.js +12 -0
- package/dist/api/resources/tts/types/RawOutputFormat.d.ts +8 -0
- package/dist/api/resources/tts/types/RawOutputFormat.js +5 -0
- package/dist/api/resources/tts/types/Speed.d.ts +10 -0
- package/dist/api/resources/tts/types/Speed.js +5 -0
- package/dist/api/resources/tts/types/SupportedLanguage.d.ts +26 -0
- package/dist/api/resources/tts/types/SupportedLanguage.js +23 -0
- package/dist/api/resources/tts/types/TtsRequest.d.ts +17 -0
- package/dist/api/resources/tts/types/TtsRequest.js +5 -0
- package/dist/api/resources/tts/types/TtsRequestEmbeddingSpecifier.d.ts +9 -0
- package/dist/api/resources/tts/types/TtsRequestEmbeddingSpecifier.js +5 -0
- package/dist/api/resources/tts/types/TtsRequestIdSpecifier.d.ts +9 -0
- package/dist/api/resources/tts/types/TtsRequestIdSpecifier.js +5 -0
- package/dist/api/resources/tts/types/TtsRequestVoiceSpecifier.d.ts +5 -0
- package/dist/api/resources/tts/types/TtsRequestVoiceSpecifier.js +5 -0
- package/dist/api/resources/tts/types/WavOutputFormat.d.ts +6 -0
- package/dist/api/resources/tts/types/WavOutputFormat.js +5 -0
- package/dist/api/resources/tts/types/WebSocketBaseResponse.d.ts +9 -0
- package/dist/api/resources/tts/types/WebSocketBaseResponse.js +5 -0
- package/dist/api/resources/tts/types/WebSocketChunkResponse.d.ts +8 -0
- package/dist/api/resources/tts/types/WebSocketChunkResponse.js +5 -0
- package/dist/api/resources/tts/types/WebSocketDoneResponse.d.ts +6 -0
- package/dist/api/resources/tts/types/WebSocketDoneResponse.js +5 -0
- package/dist/api/resources/tts/types/WebSocketErrorResponse.d.ts +7 -0
- package/dist/api/resources/tts/types/WebSocketErrorResponse.js +5 -0
- package/dist/api/resources/tts/types/WebSocketRawOutputFormat.d.ts +9 -0
- package/dist/api/resources/tts/types/WebSocketRawOutputFormat.js +5 -0
- package/dist/api/resources/tts/types/WebSocketRequest.d.ts +13 -0
- package/dist/api/resources/tts/types/WebSocketRequest.js +5 -0
- package/dist/api/resources/tts/types/WebSocketResponse.d.ts +19 -0
- package/dist/api/resources/tts/types/WebSocketResponse.js +5 -0
- package/dist/api/resources/tts/types/WebSocketStreamOptions.d.ts +6 -0
- package/dist/api/resources/tts/types/WebSocketStreamOptions.js +5 -0
- package/dist/api/resources/tts/types/WebSocketTimestampsResponse.d.ts +7 -0
- package/dist/api/resources/tts/types/WebSocketTimestampsResponse.js +5 -0
- package/dist/api/resources/tts/types/WebSocketTtsOutput.d.ts +9 -0
- package/dist/api/resources/tts/types/WebSocketTtsOutput.js +5 -0
- package/dist/api/resources/tts/types/WebSocketTtsRequest.d.ts +15 -0
- package/dist/api/resources/tts/types/WebSocketTtsRequest.js +5 -0
- package/dist/api/resources/tts/types/WordTimestamps.d.ts +8 -0
- package/dist/api/resources/tts/types/WordTimestamps.js +5 -0
- package/dist/api/resources/tts/types/index.d.ts +30 -0
- package/dist/api/resources/tts/types/index.js +46 -0
- package/dist/api/resources/voiceChanger/client/Client.d.ts +43 -0
- package/dist/api/resources/voiceChanger/client/Client.js +181 -0
- package/dist/api/resources/voiceChanger/client/index.d.ts +1 -0
- package/dist/api/resources/voiceChanger/client/index.js +17 -0
- package/dist/api/resources/voiceChanger/client/requests/VoiceChangerBytesRequest.d.ts +44 -0
- package/dist/api/resources/voiceChanger/client/requests/VoiceChangerBytesRequest.js +5 -0
- package/dist/api/resources/voiceChanger/client/requests/VoiceChangerSseRequest.d.ts +44 -0
- package/dist/api/resources/voiceChanger/client/requests/VoiceChangerSseRequest.js +5 -0
- package/dist/api/resources/voiceChanger/client/requests/index.d.ts +2 -0
- package/dist/api/resources/voiceChanger/client/requests/index.js +2 -0
- package/dist/api/resources/voiceChanger/index.d.ts +2 -0
- package/dist/api/resources/voiceChanger/index.js +18 -0
- package/dist/api/resources/voiceChanger/types/OutputFormatContainer.d.ts +9 -0
- package/dist/api/resources/voiceChanger/types/OutputFormatContainer.js +11 -0
- package/dist/api/resources/voiceChanger/types/StreamingResponse.d.ts +16 -0
- package/dist/api/resources/voiceChanger/types/StreamingResponse.js +5 -0
- package/dist/api/resources/voiceChanger/types/index.d.ts +2 -0
- package/dist/api/resources/voiceChanger/types/index.js +18 -0
- package/dist/api/resources/voices/client/Client.d.ts +141 -0
- package/dist/api/resources/voices/client/Client.js +512 -0
- package/dist/api/resources/voices/client/index.d.ts +1 -0
- package/dist/api/resources/voices/client/index.js +17 -0
- package/dist/api/resources/voices/client/requests/CloneVoiceRequest.d.ts +56 -0
- package/dist/api/resources/voices/client/requests/CloneVoiceRequest.js +5 -0
- package/dist/api/resources/voices/client/requests/index.d.ts +1 -0
- package/dist/api/resources/voices/client/requests/index.js +2 -0
- package/dist/api/resources/voices/index.d.ts +2 -0
- package/dist/api/resources/voices/index.js +18 -0
- package/dist/api/resources/voices/types/BaseVoiceId.d.ts +8 -0
- package/dist/api/resources/voices/types/BaseVoiceId.js +5 -0
- package/dist/api/resources/voices/types/CloneMode.d.ts +8 -0
- package/dist/api/resources/voices/types/CloneMode.js +10 -0
- package/dist/api/resources/voices/types/CreateVoiceRequest.d.ts +13 -0
- package/dist/api/resources/voices/types/CreateVoiceRequest.js +5 -0
- package/dist/api/resources/voices/types/EmbeddingResponse.d.ts +7 -0
- package/dist/api/resources/voices/types/EmbeddingResponse.js +5 -0
- package/dist/api/resources/voices/types/EmbeddingSpecifier.d.ts +8 -0
- package/dist/api/resources/voices/types/EmbeddingSpecifier.js +5 -0
- package/dist/api/resources/voices/types/Gender.d.ts +8 -0
- package/dist/api/resources/voices/types/Gender.js +10 -0
- package/dist/api/resources/voices/types/IdSpecifier.d.ts +8 -0
- package/dist/api/resources/voices/types/IdSpecifier.js +5 -0
- package/dist/api/resources/voices/types/LocalizeDialect.d.ts +16 -0
- package/dist/api/resources/voices/types/LocalizeDialect.js +13 -0
- package/dist/api/resources/voices/types/LocalizeTargetLanguage.d.ts +26 -0
- package/dist/api/resources/voices/types/LocalizeTargetLanguage.js +23 -0
- package/dist/api/resources/voices/types/LocalizeVoiceRequest.d.ts +10 -0
- package/dist/api/resources/voices/types/LocalizeVoiceRequest.js +5 -0
- package/dist/api/resources/voices/types/MixVoiceSpecifier.d.ts +5 -0
- package/dist/api/resources/voices/types/MixVoiceSpecifier.js +5 -0
- package/dist/api/resources/voices/types/MixVoicesRequest.d.ts +7 -0
- package/dist/api/resources/voices/types/MixVoicesRequest.js +5 -0
- package/dist/api/resources/voices/types/UpdateVoiceRequest.d.ts +9 -0
- package/dist/api/resources/voices/types/UpdateVoiceRequest.js +5 -0
- package/dist/api/resources/voices/types/Voice.d.ts +20 -0
- package/dist/api/resources/voices/types/Voice.js +5 -0
- package/dist/api/resources/voices/types/VoiceId.d.ts +7 -0
- package/dist/api/resources/voices/types/VoiceId.js +5 -0
- package/dist/api/resources/voices/types/VoiceMetadata.d.ts +18 -0
- package/dist/api/resources/voices/types/VoiceMetadata.js +5 -0
- package/dist/api/resources/voices/types/Weight.d.ts +7 -0
- package/dist/api/resources/voices/types/Weight.js +5 -0
- package/dist/api/resources/voices/types/index.d.ts +17 -0
- package/dist/api/resources/voices/types/index.js +33 -0
- package/dist/core/fetcher/APIResponse.d.ts +10 -0
- package/dist/core/fetcher/APIResponse.js +2 -0
- package/dist/core/fetcher/Fetcher.d.ts +39 -0
- package/dist/core/fetcher/Fetcher.js +99 -0
- package/dist/core/fetcher/Supplier.d.ts +4 -0
- package/dist/core/fetcher/Supplier.js +22 -0
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +13 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +59 -0
- package/dist/core/fetcher/getHeader.d.ts +1 -0
- package/dist/core/fetcher/getHeader.js +12 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +23 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +52 -0
- package/dist/core/fetcher/index.d.ts +5 -0
- package/dist/core/fetcher/index.js +9 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +42 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +41 -0
- package/dist/core/fetcher/signals.d.ts +12 -0
- package/dist/core/fetcher/signals.js +37 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +50 -0
- package/dist/core/form-data-utils/FormDataWrapper.d.ts +60 -0
- package/dist/core/form-data-utils/FormDataWrapper.js +174 -0
- package/dist/core/form-data-utils/index.d.ts +1 -0
- package/dist/core/form-data-utils/index.js +17 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/index.js +34 -0
- package/dist/core/runtime/index.d.ts +1 -0
- package/dist/core/runtime/index.js +5 -0
- package/dist/core/runtime/runtime.d.ts +9 -0
- package/dist/core/runtime/runtime.js +93 -0
- package/dist/core/schemas/Schema.d.ts +85 -0
- package/dist/core/schemas/Schema.js +22 -0
- package/dist/core/schemas/builders/bigint/bigint.d.ts +2 -0
- package/dist/core/schemas/builders/bigint/bigint.js +50 -0
- package/dist/core/schemas/builders/bigint/index.d.ts +1 -0
- package/dist/core/schemas/builders/bigint/index.js +5 -0
- package/dist/core/schemas/builders/date/date.d.ts +2 -0
- package/dist/core/schemas/builders/date/date.js +63 -0
- package/dist/core/schemas/builders/date/index.d.ts +1 -0
- package/dist/core/schemas/builders/date/index.js +5 -0
- package/dist/core/schemas/builders/enum/enum.d.ts +2 -0
- package/dist/core/schemas/builders/enum/enum.js +39 -0
- package/dist/core/schemas/builders/enum/index.d.ts +1 -0
- package/dist/core/schemas/builders/enum/index.js +5 -0
- package/dist/core/schemas/builders/index.d.ts +14 -0
- package/dist/core/schemas/builders/index.js +30 -0
- package/dist/core/schemas/builders/lazy/index.d.ts +3 -0
- package/dist/core/schemas/builders/lazy/index.js +7 -0
- package/dist/core/schemas/builders/lazy/lazy.d.ts +5 -0
- package/dist/core/schemas/builders/lazy/lazy.js +25 -0
- package/dist/core/schemas/builders/lazy/lazyObject.d.ts +3 -0
- package/dist/core/schemas/builders/lazy/lazyObject.js +12 -0
- package/dist/core/schemas/builders/list/index.d.ts +1 -0
- package/dist/core/schemas/builders/list/index.js +5 -0
- package/dist/core/schemas/builders/list/list.d.ts +2 -0
- package/dist/core/schemas/builders/list/list.js +55 -0
- package/dist/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
- package/dist/core/schemas/builders/literals/booleanLiteral.js +29 -0
- package/dist/core/schemas/builders/literals/index.d.ts +2 -0
- package/dist/core/schemas/builders/literals/index.js +7 -0
- package/dist/core/schemas/builders/literals/stringLiteral.d.ts +2 -0
- package/dist/core/schemas/builders/literals/stringLiteral.js +29 -0
- package/dist/core/schemas/builders/object/index.d.ts +6 -0
- package/dist/core/schemas/builders/object/index.js +11 -0
- package/dist/core/schemas/builders/object/object.d.ts +3 -0
- package/dist/core/schemas/builders/object/object.js +233 -0
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +8 -0
- package/dist/core/schemas/builders/object/property.d.ts +8 -0
- package/dist/core/schemas/builders/object/property.js +16 -0
- package/dist/core/schemas/builders/object/types.d.ts +26 -0
- package/dist/core/schemas/builders/object/types.js +2 -0
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.d.ts +9 -0
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +54 -0
- package/dist/core/schemas/builders/object-like/index.d.ts +2 -0
- package/dist/core/schemas/builders/object-like/index.js +6 -0
- package/dist/core/schemas/builders/object-like/types.d.ts +7 -0
- package/dist/core/schemas/builders/object-like/types.js +2 -0
- package/dist/core/schemas/builders/primitives/any.d.ts +1 -0
- package/dist/core/schemas/builders/primitives/any.js +6 -0
- package/dist/core/schemas/builders/primitives/boolean.d.ts +1 -0
- package/dist/core/schemas/builders/primitives/boolean.js +25 -0
- package/dist/core/schemas/builders/primitives/index.d.ts +5 -0
- package/dist/core/schemas/builders/primitives/index.js +13 -0
- package/dist/core/schemas/builders/primitives/number.d.ts +1 -0
- package/dist/core/schemas/builders/primitives/number.js +25 -0
- package/dist/core/schemas/builders/primitives/string.d.ts +1 -0
- package/dist/core/schemas/builders/primitives/string.js +25 -0
- package/dist/core/schemas/builders/primitives/unknown.d.ts +1 -0
- package/dist/core/schemas/builders/primitives/unknown.js +6 -0
- package/dist/core/schemas/builders/record/index.d.ts +2 -0
- package/dist/core/schemas/builders/record/index.js +5 -0
- package/dist/core/schemas/builders/record/record.d.ts +3 -0
- package/dist/core/schemas/builders/record/record.js +95 -0
- package/dist/core/schemas/builders/record/types.d.ts +4 -0
- package/dist/core/schemas/builders/record/types.js +2 -0
- package/dist/core/schemas/builders/schema-utils/JsonError.d.ts +5 -0
- package/dist/core/schemas/builders/schema-utils/JsonError.js +12 -0
- package/dist/core/schemas/builders/schema-utils/ParseError.d.ts +5 -0
- package/dist/core/schemas/builders/schema-utils/ParseError.js +12 -0
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +17 -0
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +82 -0
- package/dist/core/schemas/builders/schema-utils/index.d.ts +4 -0
- package/dist/core/schemas/builders/schema-utils/index.js +11 -0
- package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.d.ts +2 -0
- package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.js +10 -0
- package/dist/core/schemas/builders/set/index.d.ts +1 -0
- package/dist/core/schemas/builders/set/index.js +5 -0
- package/dist/core/schemas/builders/set/set.d.ts +2 -0
- package/dist/core/schemas/builders/set/set.js +44 -0
- package/dist/core/schemas/builders/undiscriminated-union/index.d.ts +2 -0
- package/dist/core/schemas/builders/undiscriminated-union/index.js +5 -0
- package/dist/core/schemas/builders/undiscriminated-union/types.d.ts +4 -0
- package/dist/core/schemas/builders/undiscriminated-union/types.js +2 -0
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.d.ts +3 -0
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +40 -0
- package/dist/core/schemas/builders/union/discriminant.d.ts +5 -0
- package/dist/core/schemas/builders/union/discriminant.js +10 -0
- package/dist/core/schemas/builders/union/index.d.ts +4 -0
- package/dist/core/schemas/builders/union/index.js +7 -0
- package/dist/core/schemas/builders/union/types.d.ts +13 -0
- package/dist/core/schemas/builders/union/types.js +2 -0
- package/dist/core/schemas/builders/union/union.d.ts +4 -0
- package/dist/core/schemas/builders/union/union.js +130 -0
- package/dist/core/schemas/index.d.ts +2 -0
- package/dist/core/schemas/index.js +17 -0
- package/dist/core/schemas/utils/MaybePromise.d.ts +1 -0
- package/dist/core/schemas/utils/MaybePromise.js +2 -0
- package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +7 -0
- package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.js +2 -0
- package/dist/core/schemas/utils/createIdentitySchemaCreator.d.ts +2 -0
- package/dist/core/schemas/utils/createIdentitySchemaCreator.js +16 -0
- package/dist/core/schemas/utils/entries.d.ts +1 -0
- package/dist/core/schemas/utils/entries.js +7 -0
- package/dist/core/schemas/utils/filterObject.d.ts +1 -0
- package/dist/core/schemas/utils/filterObject.js +14 -0
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.d.ts +1 -0
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +28 -0
- package/dist/core/schemas/utils/isPlainObject.d.ts +1 -0
- package/dist/core/schemas/utils/isPlainObject.js +18 -0
- package/dist/core/schemas/utils/keys.d.ts +1 -0
- package/dist/core/schemas/utils/keys.js +7 -0
- package/dist/core/schemas/utils/maybeSkipValidation.d.ts +2 -0
- package/dist/core/schemas/utils/maybeSkipValidation.js +28 -0
- package/dist/core/schemas/utils/partition.d.ts +1 -0
- package/dist/core/schemas/utils/partition.js +16 -0
- package/dist/core/streaming-fetcher/Stream.d.ts +48 -0
- package/dist/core/streaming-fetcher/Stream.js +170 -0
- package/dist/core/streaming-fetcher/index.d.ts +1 -0
- package/dist/core/streaming-fetcher/index.js +5 -0
- package/dist/core/websocket/events.d.ts +36 -0
- package/dist/core/websocket/events.js +27 -0
- package/dist/core/websocket/index.d.ts +1 -0
- package/dist/core/websocket/index.js +17 -0
- package/dist/core/websocket/ws.d.ts +136 -0
- package/dist/core/websocket/ws.js +438 -0
- package/dist/environments.d.ts +7 -0
- package/dist/environments.js +9 -0
- package/dist/errors/CartesiaError.d.ts +12 -0
- package/dist/errors/CartesiaError.js +32 -0
- package/dist/errors/CartesiaTimeoutError.d.ts +6 -0
- package/dist/errors/CartesiaTimeoutError.js +13 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.js +7 -0
- package/dist/index.d.ts +4 -11
- package/dist/index.js +33 -26
- package/dist/serialization/index.d.ts +1 -0
- package/dist/serialization/index.js +17 -0
- package/dist/serialization/resources/apiStatus/index.d.ts +1 -0
- package/dist/serialization/resources/apiStatus/index.js +17 -0
- package/dist/serialization/resources/apiStatus/types/ApiInfo.d.ts +13 -0
- package/dist/serialization/resources/apiStatus/types/ApiInfo.js +34 -0
- package/dist/serialization/resources/apiStatus/types/index.d.ts +1 -0
- package/dist/serialization/resources/apiStatus/types/index.js +17 -0
- package/dist/serialization/resources/embedding/index.d.ts +1 -0
- package/dist/serialization/resources/embedding/index.js +17 -0
- package/dist/serialization/resources/embedding/types/Embedding.d.ts +10 -0
- package/dist/serialization/resources/embedding/types/Embedding.js +31 -0
- package/dist/serialization/resources/embedding/types/index.d.ts +1 -0
- package/dist/serialization/resources/embedding/types/index.js +17 -0
- package/dist/serialization/resources/index.d.ts +10 -0
- package/dist/serialization/resources/index.js +39 -0
- package/dist/serialization/resources/tts/index.d.ts +1 -0
- package/dist/serialization/resources/tts/index.js +17 -0
- package/dist/serialization/resources/tts/types/CancelContextRequest.d.ts +14 -0
- package/dist/serialization/resources/tts/types/CancelContextRequest.js +35 -0
- package/dist/serialization/resources/tts/types/ContextId.d.ts +10 -0
- package/dist/serialization/resources/tts/types/ContextId.js +31 -0
- package/dist/serialization/resources/tts/types/Controls.d.ts +15 -0
- package/dist/serialization/resources/tts/types/Controls.js +36 -0
- package/dist/serialization/resources/tts/types/Emotion.d.ts +10 -0
- package/dist/serialization/resources/tts/types/Emotion.js +52 -0
- package/dist/serialization/resources/tts/types/GenerationRequest.d.ts +24 -0
- package/dist/serialization/resources/tts/types/GenerationRequest.js +45 -0
- package/dist/serialization/resources/tts/types/Mp3OutputFormat.d.ts +13 -0
- package/dist/serialization/resources/tts/types/Mp3OutputFormat.js +34 -0
- package/dist/serialization/resources/tts/types/NaturalSpecifier.d.ts +10 -0
- package/dist/serialization/resources/tts/types/NaturalSpecifier.js +31 -0
- package/dist/serialization/resources/tts/types/NumericalSpecifier.d.ts +10 -0
- package/dist/serialization/resources/tts/types/NumericalSpecifier.js +31 -0
- package/dist/serialization/resources/tts/types/OutputFormat.d.ts +22 -0
- package/dist/serialization/resources/tts/types/OutputFormat.js +43 -0
- package/dist/serialization/resources/tts/types/RawEncoding.d.ts +10 -0
- package/dist/serialization/resources/tts/types/RawEncoding.js +31 -0
- package/dist/serialization/resources/tts/types/RawOutputFormat.d.ts +14 -0
- package/dist/serialization/resources/tts/types/RawOutputFormat.js +35 -0
- package/dist/serialization/resources/tts/types/Speed.d.ts +12 -0
- package/dist/serialization/resources/tts/types/Speed.js +33 -0
- package/dist/serialization/resources/tts/types/SupportedLanguage.d.ts +10 -0
- package/dist/serialization/resources/tts/types/SupportedLanguage.js +47 -0
- package/dist/serialization/resources/tts/types/TtsRequest.d.ts +20 -0
- package/dist/serialization/resources/tts/types/TtsRequest.js +41 -0
- package/dist/serialization/resources/tts/types/TtsRequestEmbeddingSpecifier.d.ts +16 -0
- package/dist/serialization/resources/tts/types/TtsRequestEmbeddingSpecifier.js +37 -0
- package/dist/serialization/resources/tts/types/TtsRequestIdSpecifier.d.ts +16 -0
- package/dist/serialization/resources/tts/types/TtsRequestIdSpecifier.js +37 -0
- package/dist/serialization/resources/tts/types/TtsRequestVoiceSpecifier.d.ts +12 -0
- package/dist/serialization/resources/tts/types/TtsRequestVoiceSpecifier.js +33 -0
- package/dist/serialization/resources/tts/types/WavOutputFormat.d.ts +12 -0
- package/dist/serialization/resources/tts/types/WavOutputFormat.js +32 -0
- package/dist/serialization/resources/tts/types/WebSocketBaseResponse.d.ts +15 -0
- package/dist/serialization/resources/tts/types/WebSocketBaseResponse.js +36 -0
- package/dist/serialization/resources/tts/types/WebSocketChunkResponse.d.ts +14 -0
- package/dist/serialization/resources/tts/types/WebSocketChunkResponse.js +37 -0
- package/dist/serialization/resources/tts/types/WebSocketDoneResponse.d.ts +12 -0
- package/dist/serialization/resources/tts/types/WebSocketDoneResponse.js +32 -0
- package/dist/serialization/resources/tts/types/WebSocketErrorResponse.d.ts +13 -0
- package/dist/serialization/resources/tts/types/WebSocketErrorResponse.js +36 -0
- package/dist/serialization/resources/tts/types/WebSocketRawOutputFormat.d.ts +15 -0
- package/dist/serialization/resources/tts/types/WebSocketRawOutputFormat.js +36 -0
- package/dist/serialization/resources/tts/types/WebSocketRequest.d.ts +12 -0
- package/dist/serialization/resources/tts/types/WebSocketRequest.js +33 -0
- package/dist/serialization/resources/tts/types/WebSocketResponse.d.ts +26 -0
- package/dist/serialization/resources/tts/types/WebSocketResponse.js +45 -0
- package/dist/serialization/resources/tts/types/WebSocketStreamOptions.d.ts +12 -0
- package/dist/serialization/resources/tts/types/WebSocketStreamOptions.js +33 -0
- package/dist/serialization/resources/tts/types/WebSocketTimestampsResponse.d.ts +14 -0
- package/dist/serialization/resources/tts/types/WebSocketTimestampsResponse.js +37 -0
- package/dist/serialization/resources/tts/types/WebSocketTtsOutput.d.ts +16 -0
- package/dist/serialization/resources/tts/types/WebSocketTtsOutput.js +37 -0
- package/dist/serialization/resources/tts/types/WebSocketTtsRequest.d.ts +21 -0
- package/dist/serialization/resources/tts/types/WebSocketTtsRequest.js +42 -0
- package/dist/serialization/resources/tts/types/WordTimestamps.d.ts +14 -0
- package/dist/serialization/resources/tts/types/WordTimestamps.js +35 -0
- package/dist/serialization/resources/tts/types/index.d.ts +30 -0
- package/dist/serialization/resources/tts/types/index.js +46 -0
- package/dist/serialization/resources/voiceChanger/index.d.ts +1 -0
- package/dist/serialization/resources/voiceChanger/index.js +17 -0
- package/dist/serialization/resources/voiceChanger/types/OutputFormatContainer.d.ts +10 -0
- package/dist/serialization/resources/voiceChanger/types/OutputFormatContainer.js +31 -0
- package/dist/serialization/resources/voiceChanger/types/StreamingResponse.d.ts +22 -0
- package/dist/serialization/resources/voiceChanger/types/StreamingResponse.js +43 -0
- package/dist/serialization/resources/voiceChanger/types/index.d.ts +2 -0
- package/dist/serialization/resources/voiceChanger/types/index.js +18 -0
- package/dist/serialization/resources/voices/client/index.d.ts +1 -0
- package/dist/serialization/resources/voices/client/index.js +27 -0
- package/dist/serialization/resources/voices/client/list.d.ts +11 -0
- package/dist/serialization/resources/voices/client/list.js +32 -0
- package/dist/serialization/resources/voices/index.d.ts +2 -0
- package/dist/serialization/resources/voices/index.js +18 -0
- package/dist/serialization/resources/voices/types/BaseVoiceId.d.ts +11 -0
- package/dist/serialization/resources/voices/types/BaseVoiceId.js +8 -0
- package/dist/serialization/resources/voices/types/CloneMode.d.ts +10 -0
- package/dist/serialization/resources/voices/types/CloneMode.js +31 -0
- package/dist/serialization/resources/voices/types/CreateVoiceRequest.d.ts +19 -0
- package/dist/serialization/resources/voices/types/CreateVoiceRequest.js +40 -0
- package/dist/serialization/resources/voices/types/EmbeddingResponse.d.ts +13 -0
- package/dist/serialization/resources/voices/types/EmbeddingResponse.js +34 -0
- package/dist/serialization/resources/voices/types/EmbeddingSpecifier.d.ts +15 -0
- package/dist/serialization/resources/voices/types/EmbeddingSpecifier.js +36 -0
- package/dist/serialization/resources/voices/types/Gender.d.ts +10 -0
- package/dist/serialization/resources/voices/types/Gender.js +34 -0
- package/dist/serialization/resources/voices/types/IdSpecifier.d.ts +15 -0
- package/dist/serialization/resources/voices/types/IdSpecifier.js +36 -0
- package/dist/serialization/resources/voices/types/LocalizeDialect.d.ts +10 -0
- package/dist/serialization/resources/voices/types/LocalizeDialect.js +31 -0
- package/dist/serialization/resources/voices/types/LocalizeTargetLanguage.d.ts +10 -0
- package/dist/serialization/resources/voices/types/LocalizeTargetLanguage.js +47 -0
- package/dist/serialization/resources/voices/types/LocalizeVoiceRequest.d.ts +19 -0
- package/dist/serialization/resources/voices/types/LocalizeVoiceRequest.js +40 -0
- package/dist/serialization/resources/voices/types/MixVoiceSpecifier.d.ts +12 -0
- package/dist/serialization/resources/voices/types/MixVoiceSpecifier.js +33 -0
- package/dist/serialization/resources/voices/types/MixVoicesRequest.d.ts +13 -0
- package/dist/serialization/resources/voices/types/MixVoicesRequest.js +34 -0
- package/dist/serialization/resources/voices/types/UpdateVoiceRequest.d.ts +13 -0
- package/dist/serialization/resources/voices/types/UpdateVoiceRequest.js +34 -0
- package/dist/serialization/resources/voices/types/Voice.d.ts +24 -0
- package/dist/serialization/resources/voices/types/Voice.js +45 -0
- package/dist/serialization/resources/voices/types/VoiceId.d.ts +10 -0
- package/dist/serialization/resources/voices/types/VoiceId.js +31 -0
- package/dist/serialization/resources/voices/types/VoiceMetadata.d.ts +20 -0
- package/dist/serialization/resources/voices/types/VoiceMetadata.js +41 -0
- package/dist/serialization/resources/voices/types/Weight.d.ts +10 -0
- package/dist/serialization/resources/voices/types/Weight.js +31 -0
- package/dist/serialization/resources/voices/types/index.d.ts +17 -0
- package/dist/serialization/resources/voices/types/index.js +33 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +4 -0
- package/dist/wrapper/Client.d.ts +6 -0
- package/dist/wrapper/Client.js +12 -0
- package/dist/wrapper/StreamingTTSClient.d.ts +16 -0
- package/dist/wrapper/StreamingTTSClient.js +23 -0
- package/dist/{tts/player.d.ts → wrapper/WebPlayer.d.ts} +2 -7
- package/dist/wrapper/WebPlayer.js +141 -0
- package/dist/wrapper/Websocket.d.ts +57 -0
- package/dist/wrapper/Websocket.js +218 -0
- package/dist/{tts → wrapper}/source.d.ts +8 -16
- package/dist/wrapper/source.js +179 -0
- package/dist/wrapper/utils.d.ts +105 -0
- package/dist/wrapper/utils.js +173 -0
- package/environments.d.ts +7 -0
- package/environments.js +9 -0
- package/errors/CartesiaError.d.ts +12 -0
- package/errors/CartesiaError.js +32 -0
- package/errors/CartesiaTimeoutError.d.ts +6 -0
- package/errors/CartesiaTimeoutError.js +13 -0
- package/errors/index.d.ts +2 -0
- package/errors/index.js +7 -0
- package/index.d.ts +4 -0
- package/index.js +34 -0
- package/jest.config.js +5 -0
- package/package.json +45 -46
- package/reference.md +771 -0
- package/serialization/index.d.ts +1 -0
- package/serialization/index.js +17 -0
- package/serialization/resources/apiStatus/index.d.ts +1 -0
- package/serialization/resources/apiStatus/index.js +17 -0
- package/serialization/resources/apiStatus/types/ApiInfo.d.ts +13 -0
- package/serialization/resources/apiStatus/types/ApiInfo.js +34 -0
- package/serialization/resources/apiStatus/types/index.d.ts +1 -0
- package/serialization/resources/apiStatus/types/index.js +17 -0
- package/serialization/resources/embedding/index.d.ts +1 -0
- package/serialization/resources/embedding/index.js +17 -0
- package/serialization/resources/embedding/types/Embedding.d.ts +10 -0
- package/serialization/resources/embedding/types/Embedding.js +31 -0
- package/serialization/resources/embedding/types/index.d.ts +1 -0
- package/serialization/resources/embedding/types/index.js +17 -0
- package/serialization/resources/index.d.ts +10 -0
- package/serialization/resources/index.js +39 -0
- package/serialization/resources/tts/index.d.ts +1 -0
- package/serialization/resources/tts/index.js +17 -0
- package/serialization/resources/tts/types/CancelContextRequest.d.ts +14 -0
- package/serialization/resources/tts/types/CancelContextRequest.js +35 -0
- package/serialization/resources/tts/types/ContextId.d.ts +10 -0
- package/serialization/resources/tts/types/ContextId.js +31 -0
- package/serialization/resources/tts/types/Controls.d.ts +15 -0
- package/serialization/resources/tts/types/Controls.js +36 -0
- package/serialization/resources/tts/types/Emotion.d.ts +10 -0
- package/serialization/resources/tts/types/Emotion.js +52 -0
- package/serialization/resources/tts/types/GenerationRequest.d.ts +24 -0
- package/serialization/resources/tts/types/GenerationRequest.js +45 -0
- package/serialization/resources/tts/types/Mp3OutputFormat.d.ts +13 -0
- package/serialization/resources/tts/types/Mp3OutputFormat.js +34 -0
- package/serialization/resources/tts/types/NaturalSpecifier.d.ts +10 -0
- package/serialization/resources/tts/types/NaturalSpecifier.js +31 -0
- package/serialization/resources/tts/types/NumericalSpecifier.d.ts +10 -0
- package/serialization/resources/tts/types/NumericalSpecifier.js +31 -0
- package/serialization/resources/tts/types/OutputFormat.d.ts +22 -0
- package/serialization/resources/tts/types/OutputFormat.js +43 -0
- package/serialization/resources/tts/types/RawEncoding.d.ts +10 -0
- package/serialization/resources/tts/types/RawEncoding.js +31 -0
- package/serialization/resources/tts/types/RawOutputFormat.d.ts +14 -0
- package/serialization/resources/tts/types/RawOutputFormat.js +35 -0
- package/serialization/resources/tts/types/Speed.d.ts +12 -0
- package/serialization/resources/tts/types/Speed.js +33 -0
- package/serialization/resources/tts/types/SupportedLanguage.d.ts +10 -0
- package/serialization/resources/tts/types/SupportedLanguage.js +47 -0
- package/serialization/resources/tts/types/TtsRequest.d.ts +20 -0
- package/serialization/resources/tts/types/TtsRequest.js +41 -0
- package/serialization/resources/tts/types/TtsRequestEmbeddingSpecifier.d.ts +16 -0
- package/serialization/resources/tts/types/TtsRequestEmbeddingSpecifier.js +37 -0
- package/serialization/resources/tts/types/TtsRequestIdSpecifier.d.ts +16 -0
- package/serialization/resources/tts/types/TtsRequestIdSpecifier.js +37 -0
- package/serialization/resources/tts/types/TtsRequestVoiceSpecifier.d.ts +12 -0
- package/serialization/resources/tts/types/TtsRequestVoiceSpecifier.js +33 -0
- package/serialization/resources/tts/types/WavOutputFormat.d.ts +12 -0
- package/serialization/resources/tts/types/WavOutputFormat.js +32 -0
- package/serialization/resources/tts/types/WebSocketBaseResponse.d.ts +15 -0
- package/serialization/resources/tts/types/WebSocketBaseResponse.js +36 -0
- package/serialization/resources/tts/types/WebSocketChunkResponse.d.ts +14 -0
- package/serialization/resources/tts/types/WebSocketChunkResponse.js +37 -0
- package/serialization/resources/tts/types/WebSocketDoneResponse.d.ts +12 -0
- package/serialization/resources/tts/types/WebSocketDoneResponse.js +32 -0
- package/serialization/resources/tts/types/WebSocketErrorResponse.d.ts +13 -0
- package/serialization/resources/tts/types/WebSocketErrorResponse.js +36 -0
- package/serialization/resources/tts/types/WebSocketRawOutputFormat.d.ts +15 -0
- package/serialization/resources/tts/types/WebSocketRawOutputFormat.js +36 -0
- package/serialization/resources/tts/types/WebSocketRequest.d.ts +12 -0
- package/serialization/resources/tts/types/WebSocketRequest.js +33 -0
- package/serialization/resources/tts/types/WebSocketResponse.d.ts +26 -0
- package/serialization/resources/tts/types/WebSocketResponse.js +45 -0
- package/serialization/resources/tts/types/WebSocketStreamOptions.d.ts +12 -0
- package/serialization/resources/tts/types/WebSocketStreamOptions.js +33 -0
- package/serialization/resources/tts/types/WebSocketTimestampsResponse.d.ts +14 -0
- package/serialization/resources/tts/types/WebSocketTimestampsResponse.js +37 -0
- package/serialization/resources/tts/types/WebSocketTtsOutput.d.ts +16 -0
- package/serialization/resources/tts/types/WebSocketTtsOutput.js +37 -0
- package/serialization/resources/tts/types/WebSocketTtsRequest.d.ts +21 -0
- package/serialization/resources/tts/types/WebSocketTtsRequest.js +42 -0
- package/serialization/resources/tts/types/WordTimestamps.d.ts +14 -0
- package/serialization/resources/tts/types/WordTimestamps.js +35 -0
- package/serialization/resources/tts/types/index.d.ts +30 -0
- package/serialization/resources/tts/types/index.js +46 -0
- package/serialization/resources/voiceChanger/index.d.ts +1 -0
- package/serialization/resources/voiceChanger/index.js +17 -0
- package/serialization/resources/voiceChanger/types/OutputFormatContainer.d.ts +10 -0
- package/serialization/resources/voiceChanger/types/OutputFormatContainer.js +31 -0
- package/serialization/resources/voiceChanger/types/StreamingResponse.d.ts +22 -0
- package/serialization/resources/voiceChanger/types/StreamingResponse.js +43 -0
- package/serialization/resources/voiceChanger/types/index.d.ts +2 -0
- package/serialization/resources/voiceChanger/types/index.js +18 -0
- package/serialization/resources/voices/client/index.d.ts +1 -0
- package/serialization/resources/voices/client/index.js +27 -0
- package/serialization/resources/voices/client/list.d.ts +11 -0
- package/serialization/resources/voices/client/list.js +32 -0
- package/serialization/resources/voices/index.d.ts +2 -0
- package/serialization/resources/voices/index.js +18 -0
- package/serialization/resources/voices/types/BaseVoiceId.d.ts +11 -0
- package/serialization/resources/voices/types/BaseVoiceId.js +8 -0
- package/serialization/resources/voices/types/CloneMode.d.ts +10 -0
- package/serialization/resources/voices/types/CloneMode.js +31 -0
- package/serialization/resources/voices/types/CreateVoiceRequest.d.ts +19 -0
- package/serialization/resources/voices/types/CreateVoiceRequest.js +40 -0
- package/serialization/resources/voices/types/EmbeddingResponse.d.ts +13 -0
- package/serialization/resources/voices/types/EmbeddingResponse.js +34 -0
- package/serialization/resources/voices/types/EmbeddingSpecifier.d.ts +15 -0
- package/serialization/resources/voices/types/EmbeddingSpecifier.js +36 -0
- package/serialization/resources/voices/types/Gender.d.ts +10 -0
- package/serialization/resources/voices/types/Gender.js +34 -0
- package/serialization/resources/voices/types/IdSpecifier.d.ts +15 -0
- package/serialization/resources/voices/types/IdSpecifier.js +36 -0
- package/serialization/resources/voices/types/LocalizeDialect.d.ts +10 -0
- package/serialization/resources/voices/types/LocalizeDialect.js +31 -0
- package/serialization/resources/voices/types/LocalizeTargetLanguage.d.ts +10 -0
- package/serialization/resources/voices/types/LocalizeTargetLanguage.js +47 -0
- package/serialization/resources/voices/types/LocalizeVoiceRequest.d.ts +19 -0
- package/serialization/resources/voices/types/LocalizeVoiceRequest.js +40 -0
- package/serialization/resources/voices/types/MixVoiceSpecifier.d.ts +12 -0
- package/serialization/resources/voices/types/MixVoiceSpecifier.js +33 -0
- package/serialization/resources/voices/types/MixVoicesRequest.d.ts +13 -0
- package/serialization/resources/voices/types/MixVoicesRequest.js +34 -0
- package/serialization/resources/voices/types/UpdateVoiceRequest.d.ts +13 -0
- package/serialization/resources/voices/types/UpdateVoiceRequest.js +34 -0
- package/serialization/resources/voices/types/Voice.d.ts +24 -0
- package/serialization/resources/voices/types/Voice.js +45 -0
- package/serialization/resources/voices/types/VoiceId.d.ts +10 -0
- package/serialization/resources/voices/types/VoiceId.js +31 -0
- package/serialization/resources/voices/types/VoiceMetadata.d.ts +20 -0
- package/serialization/resources/voices/types/VoiceMetadata.js +41 -0
- package/serialization/resources/voices/types/Weight.d.ts +10 -0
- package/serialization/resources/voices/types/Weight.js +31 -0
- package/serialization/resources/voices/types/index.d.ts +17 -0
- package/serialization/resources/voices/types/index.js +33 -0
- package/version.d.ts +1 -0
- package/version.js +4 -0
- package/wrapper/Client.d.ts +6 -0
- package/wrapper/Client.js +12 -0
- package/wrapper/StreamingTTSClient.d.ts +16 -0
- package/wrapper/StreamingTTSClient.js +23 -0
- package/{dist/tts/player.d.cts → wrapper/WebPlayer.d.ts} +2 -7
- package/wrapper/WebPlayer.js +141 -0
- package/wrapper/Websocket.d.ts +57 -0
- package/wrapper/Websocket.js +218 -0
- package/{dist/tts/source.d.cts → wrapper/source.d.ts} +8 -16
- package/wrapper/source.js +179 -0
- package/wrapper/utils.d.ts +105 -0
- package/wrapper/utils.js +173 -0
- package/CHANGELOG.md +0 -90
- package/LICENSE.md +0 -21
- package/dist/chunk-2BFEKY3F.js +0 -16
- package/dist/chunk-5SBAQNWQ.js +0 -86
- package/dist/chunk-62LXGS65.js +0 -116
- package/dist/chunk-CSOXALSC.js +0 -132
- package/dist/chunk-EYRYHK3X.js +0 -43
- package/dist/chunk-FLWYXP5Z.js +0 -40
- package/dist/chunk-FXPGR372.js +0 -0
- package/dist/chunk-HQOC2S6C.js +0 -264
- package/dist/chunk-I5YVYTNK.js +0 -190
- package/dist/chunk-LKKWJLUG.js +0 -17
- package/dist/chunk-MGVQHO25.js +0 -26
- package/dist/chunk-NJDRWDQ3.js +0 -57
- package/dist/chunk-WLEVU3HN.js +0 -42
- package/dist/index.cjs +0 -910
- package/dist/index.d.cts +0 -11
- package/dist/lib/client.cjs +0 -113
- package/dist/lib/client.d.cts +0 -11
- package/dist/lib/client.d.ts +0 -11
- package/dist/lib/client.js +0 -8
- package/dist/lib/constants.cjs +0 -42
- package/dist/lib/constants.d.cts +0 -16
- package/dist/lib/constants.d.ts +0 -16
- package/dist/lib/constants.js +0 -11
- package/dist/lib/index.cjs +0 -772
- package/dist/lib/index.d.cts +0 -18
- package/dist/lib/index.d.ts +0 -18
- package/dist/lib/index.js +0 -15
- package/dist/react/index.cjs +0 -1164
- package/dist/react/index.d.cts +0 -34
- package/dist/react/index.d.ts +0 -34
- package/dist/react/index.js +0 -274
- package/dist/react/utils.cjs +0 -57
- package/dist/react/utils.d.cts +0 -7
- package/dist/react/utils.d.ts +0 -7
- package/dist/react/utils.js +0 -7
- package/dist/tts/index.cjs +0 -620
- package/dist/tts/index.d.cts +0 -24
- package/dist/tts/index.d.ts +0 -24
- package/dist/tts/index.js +0 -12
- package/dist/tts/player.cjs +0 -202
- package/dist/tts/player.js +0 -9
- package/dist/tts/source.cjs +0 -244
- package/dist/tts/source.js +0 -9
- package/dist/tts/utils.cjs +0 -134
- package/dist/tts/utils.d.cts +0 -69
- package/dist/tts/utils.d.ts +0 -69
- package/dist/tts/utils.js +0 -22
- package/dist/tts/websocket.cjs +0 -588
- package/dist/tts/websocket.d.cts +0 -69
- package/dist/tts/websocket.d.ts +0 -69
- package/dist/tts/websocket.js +0 -11
- package/dist/types/index.cjs +0 -18
- package/dist/types/index.d.cts +0 -173
- package/dist/types/index.d.ts +0 -173
- package/dist/types/index.js +0 -1
- package/dist/voice-changer/index.cjs +0 -143
- package/dist/voice-changer/index.d.cts +0 -9
- package/dist/voice-changer/index.d.ts +0 -9
- package/dist/voice-changer/index.js +0 -9
- package/dist/voices/index.cjs +0 -217
- package/dist/voices/index.d.cts +0 -16
- package/dist/voices/index.d.ts +0 -16
- package/dist/voices/index.js +0 -9
- package/src/index.ts +0 -6
- package/src/lib/client.ts +0 -31
- package/src/lib/constants.ts +0 -25
- package/src/lib/index.ts +0 -19
- package/src/react/index.ts +0 -303
- package/src/react/utils.ts +0 -11
- package/src/tts/index.ts +0 -32
- package/src/tts/player.ts +0 -117
- package/src/tts/source.ts +0 -196
- package/src/tts/utils.ts +0 -164
- package/src/tts/websocket.ts +0 -271
- package/src/types/index.ts +0 -233
- package/src/voice-changer/index.ts +0 -37
- package/src/voices/index.ts +0 -116
package/dist/tts/player.cjs
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __typeError = (msg) => {
|
|
9
|
-
throw TypeError(msg);
|
|
10
|
-
};
|
|
11
|
-
var __export = (target, all) => {
|
|
12
|
-
for (var name in all)
|
|
13
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
-
};
|
|
15
|
-
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
-
for (let key of __getOwnPropNames(from))
|
|
18
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
-
}
|
|
21
|
-
return to;
|
|
22
|
-
};
|
|
23
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
-
mod
|
|
30
|
-
));
|
|
31
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
33
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
34
|
-
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
35
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
36
|
-
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
37
|
-
var __async = (__this, __arguments, generator) => {
|
|
38
|
-
return new Promise((resolve, reject) => {
|
|
39
|
-
var fulfilled = (value) => {
|
|
40
|
-
try {
|
|
41
|
-
step(generator.next(value));
|
|
42
|
-
} catch (e) {
|
|
43
|
-
reject(e);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
var rejected = (value) => {
|
|
47
|
-
try {
|
|
48
|
-
step(generator.throw(value));
|
|
49
|
-
} catch (e) {
|
|
50
|
-
reject(e);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
54
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
// src/tts/player.ts
|
|
59
|
-
var player_exports = {};
|
|
60
|
-
__export(player_exports, {
|
|
61
|
-
default: () => Player
|
|
62
|
-
});
|
|
63
|
-
module.exports = __toCommonJS(player_exports);
|
|
64
|
-
|
|
65
|
-
// src/tts/utils.ts
|
|
66
|
-
var import_base64_js = __toESM(require("base64-js"), 1);
|
|
67
|
-
|
|
68
|
-
// src/tts/source.ts
|
|
69
|
-
var import_emittery = __toESM(require("emittery"), 1);
|
|
70
|
-
|
|
71
|
-
// src/tts/utils.ts
|
|
72
|
-
function playAudioBuffer(floats, context, startAt, sampleRate) {
|
|
73
|
-
const source = context.createBufferSource();
|
|
74
|
-
const buffer = context.createBuffer(1, floats.length, sampleRate);
|
|
75
|
-
buffer.getChannelData(0).set(floats);
|
|
76
|
-
source.buffer = buffer;
|
|
77
|
-
source.connect(context.destination);
|
|
78
|
-
source.start(startAt);
|
|
79
|
-
return new Promise((resolve) => {
|
|
80
|
-
source.onended = () => {
|
|
81
|
-
resolve();
|
|
82
|
-
};
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// src/tts/player.ts
|
|
87
|
-
var _context, _startNextPlaybackAt, _bufferDuration, _Player_instances, playBuffer_fn;
|
|
88
|
-
var Player = class {
|
|
89
|
-
/**
|
|
90
|
-
* Create a new Player.
|
|
91
|
-
*
|
|
92
|
-
* @param options - Options for the Player.
|
|
93
|
-
* @param options.bufferDuration - The duration of the audio buffer to play.
|
|
94
|
-
*/
|
|
95
|
-
constructor({ bufferDuration }) {
|
|
96
|
-
__privateAdd(this, _Player_instances);
|
|
97
|
-
__privateAdd(this, _context, null);
|
|
98
|
-
__privateAdd(this, _startNextPlaybackAt, 0);
|
|
99
|
-
__privateAdd(this, _bufferDuration);
|
|
100
|
-
__privateSet(this, _bufferDuration, bufferDuration);
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Play audio from a source.
|
|
104
|
-
*
|
|
105
|
-
* @param source The source to play audio from.
|
|
106
|
-
* @returns A promise that resolves when the audio has finished playing.
|
|
107
|
-
*/
|
|
108
|
-
play(source) {
|
|
109
|
-
return __async(this, null, function* () {
|
|
110
|
-
__privateSet(this, _startNextPlaybackAt, 0);
|
|
111
|
-
__privateSet(this, _context, new AudioContext({ sampleRate: source.sampleRate }));
|
|
112
|
-
const buffer = new Float32Array(
|
|
113
|
-
source.durationToSampleCount(__privateGet(this, _bufferDuration))
|
|
114
|
-
);
|
|
115
|
-
const plays = [];
|
|
116
|
-
while (true) {
|
|
117
|
-
const read = yield source.read(buffer);
|
|
118
|
-
const playableAudio = buffer.subarray(0, read);
|
|
119
|
-
plays.push(__privateMethod(this, _Player_instances, playBuffer_fn).call(this, playableAudio, source.sampleRate));
|
|
120
|
-
if (read < buffer.length) {
|
|
121
|
-
break;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
yield Promise.all(plays);
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Pause the audio.
|
|
129
|
-
*
|
|
130
|
-
* @returns A promise that resolves when the audio has been paused.
|
|
131
|
-
*/
|
|
132
|
-
pause() {
|
|
133
|
-
return __async(this, null, function* () {
|
|
134
|
-
if (!__privateGet(this, _context)) {
|
|
135
|
-
throw new Error("AudioContext not initialized.");
|
|
136
|
-
}
|
|
137
|
-
yield __privateGet(this, _context).suspend();
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Resume the audio.
|
|
142
|
-
*
|
|
143
|
-
* @returns A promise that resolves when the audio has been resumed.
|
|
144
|
-
*/
|
|
145
|
-
resume() {
|
|
146
|
-
return __async(this, null, function* () {
|
|
147
|
-
if (!__privateGet(this, _context)) {
|
|
148
|
-
throw new Error("AudioContext not initialized.");
|
|
149
|
-
}
|
|
150
|
-
yield __privateGet(this, _context).resume();
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Toggle the audio.
|
|
155
|
-
*
|
|
156
|
-
* @returns A promise that resolves when the audio has been toggled.
|
|
157
|
-
*/
|
|
158
|
-
toggle() {
|
|
159
|
-
return __async(this, null, function* () {
|
|
160
|
-
if (!__privateGet(this, _context)) {
|
|
161
|
-
throw new Error("AudioContext not initialized.");
|
|
162
|
-
}
|
|
163
|
-
if (__privateGet(this, _context).state === "running") {
|
|
164
|
-
yield this.pause();
|
|
165
|
-
} else {
|
|
166
|
-
yield this.resume();
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Stop the audio.
|
|
172
|
-
*
|
|
173
|
-
* @returns A promise that resolves when the audio has been stopped.
|
|
174
|
-
*/
|
|
175
|
-
stop() {
|
|
176
|
-
return __async(this, null, function* () {
|
|
177
|
-
var _a;
|
|
178
|
-
if (!__privateGet(this, _context)) {
|
|
179
|
-
throw new Error("AudioContext not initialized.");
|
|
180
|
-
}
|
|
181
|
-
yield (_a = __privateGet(this, _context)) == null ? void 0 : _a.close();
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
_context = new WeakMap();
|
|
186
|
-
_startNextPlaybackAt = new WeakMap();
|
|
187
|
-
_bufferDuration = new WeakMap();
|
|
188
|
-
_Player_instances = new WeakSet();
|
|
189
|
-
playBuffer_fn = function(buf, sampleRate) {
|
|
190
|
-
return __async(this, null, function* () {
|
|
191
|
-
if (!__privateGet(this, _context)) {
|
|
192
|
-
throw new Error("AudioContext not initialized.");
|
|
193
|
-
}
|
|
194
|
-
if (buf.length === 0) {
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
const startAt = __privateGet(this, _startNextPlaybackAt);
|
|
198
|
-
const duration = buf.length / sampleRate;
|
|
199
|
-
__privateSet(this, _startNextPlaybackAt, duration + Math.max(__privateGet(this, _context).currentTime, __privateGet(this, _startNextPlaybackAt)));
|
|
200
|
-
yield playAudioBuffer(buf, __privateGet(this, _context), startAt, sampleRate);
|
|
201
|
-
});
|
|
202
|
-
};
|
package/dist/tts/player.js
DELETED
package/dist/tts/source.cjs
DELETED
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __typeError = (msg) => {
|
|
9
|
-
throw TypeError(msg);
|
|
10
|
-
};
|
|
11
|
-
var __export = (target, all) => {
|
|
12
|
-
for (var name in all)
|
|
13
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
-
};
|
|
15
|
-
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
-
for (let key of __getOwnPropNames(from))
|
|
18
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
-
}
|
|
21
|
-
return to;
|
|
22
|
-
};
|
|
23
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
-
mod
|
|
30
|
-
));
|
|
31
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
33
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
34
|
-
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
35
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
36
|
-
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
37
|
-
var __async = (__this, __arguments, generator) => {
|
|
38
|
-
return new Promise((resolve, reject) => {
|
|
39
|
-
var fulfilled = (value) => {
|
|
40
|
-
try {
|
|
41
|
-
step(generator.next(value));
|
|
42
|
-
} catch (e) {
|
|
43
|
-
reject(e);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
var rejected = (value) => {
|
|
47
|
-
try {
|
|
48
|
-
step(generator.throw(value));
|
|
49
|
-
} catch (e) {
|
|
50
|
-
reject(e);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
54
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
// src/tts/source.ts
|
|
59
|
-
var source_exports = {};
|
|
60
|
-
__export(source_exports, {
|
|
61
|
-
ENCODING_MAP: () => ENCODING_MAP,
|
|
62
|
-
default: () => Source
|
|
63
|
-
});
|
|
64
|
-
module.exports = __toCommonJS(source_exports);
|
|
65
|
-
var import_emittery = __toESM(require("emittery"), 1);
|
|
66
|
-
var ENCODING_MAP = {
|
|
67
|
-
pcm_f32le: { arrayType: Float32Array, bytesPerElement: 4 },
|
|
68
|
-
pcm_s16le: { arrayType: Int16Array, bytesPerElement: 2 },
|
|
69
|
-
pcm_alaw: { arrayType: Uint8Array, bytesPerElement: 1 },
|
|
70
|
-
pcm_mulaw: { arrayType: Uint8Array, bytesPerElement: 1 }
|
|
71
|
-
};
|
|
72
|
-
var _emitter, _buffer, _readIndex, _writeIndex, _closed, _sampleRate, _encoding, _container, _Source_instances, createBuffer_fn;
|
|
73
|
-
var Source = class {
|
|
74
|
-
/**
|
|
75
|
-
* Create a new Source.
|
|
76
|
-
*
|
|
77
|
-
* @param options - Options for the Source.
|
|
78
|
-
* @param options.sampleRate - The sample rate of the audio.
|
|
79
|
-
*/
|
|
80
|
-
constructor({
|
|
81
|
-
sampleRate,
|
|
82
|
-
encoding,
|
|
83
|
-
container
|
|
84
|
-
}) {
|
|
85
|
-
__privateAdd(this, _Source_instances);
|
|
86
|
-
__privateAdd(this, _emitter, new import_emittery.default());
|
|
87
|
-
__privateAdd(this, _buffer);
|
|
88
|
-
__privateAdd(this, _readIndex, 0);
|
|
89
|
-
__privateAdd(this, _writeIndex, 0);
|
|
90
|
-
__privateAdd(this, _closed, false);
|
|
91
|
-
__privateAdd(this, _sampleRate);
|
|
92
|
-
__privateAdd(this, _encoding);
|
|
93
|
-
__privateAdd(this, _container);
|
|
94
|
-
this.on = __privateGet(this, _emitter).on.bind(__privateGet(this, _emitter));
|
|
95
|
-
this.once = __privateGet(this, _emitter).once.bind(__privateGet(this, _emitter));
|
|
96
|
-
this.events = __privateGet(this, _emitter).events.bind(__privateGet(this, _emitter));
|
|
97
|
-
this.off = __privateGet(this, _emitter).off.bind(__privateGet(this, _emitter));
|
|
98
|
-
__privateSet(this, _sampleRate, sampleRate);
|
|
99
|
-
__privateSet(this, _encoding, encoding);
|
|
100
|
-
__privateSet(this, _container, container);
|
|
101
|
-
__privateSet(this, _buffer, __privateMethod(this, _Source_instances, createBuffer_fn).call(this, 1024));
|
|
102
|
-
}
|
|
103
|
-
get sampleRate() {
|
|
104
|
-
return __privateGet(this, _sampleRate);
|
|
105
|
-
}
|
|
106
|
-
get encoding() {
|
|
107
|
-
return __privateGet(this, _encoding);
|
|
108
|
-
}
|
|
109
|
-
get container() {
|
|
110
|
-
return __privateGet(this, _container);
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Append audio to the buffer.
|
|
114
|
-
*
|
|
115
|
-
* @param src The audio to append.
|
|
116
|
-
*/
|
|
117
|
-
enqueue(src) {
|
|
118
|
-
return __async(this, null, function* () {
|
|
119
|
-
const requiredCapacity = __privateGet(this, _writeIndex) + src.length;
|
|
120
|
-
if (requiredCapacity > __privateGet(this, _buffer).length) {
|
|
121
|
-
let newCapacity = __privateGet(this, _buffer).length;
|
|
122
|
-
while (newCapacity < requiredCapacity) {
|
|
123
|
-
newCapacity *= 2;
|
|
124
|
-
}
|
|
125
|
-
const newBuffer = __privateMethod(this, _Source_instances, createBuffer_fn).call(this, newCapacity);
|
|
126
|
-
newBuffer.set(__privateGet(this, _buffer));
|
|
127
|
-
__privateSet(this, _buffer, newBuffer);
|
|
128
|
-
}
|
|
129
|
-
__privateGet(this, _buffer).set(src, __privateGet(this, _writeIndex));
|
|
130
|
-
__privateSet(this, _writeIndex, __privateGet(this, _writeIndex) + src.length);
|
|
131
|
-
yield __privateGet(this, _emitter).emit("enqueue");
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Read audio from the buffer.
|
|
136
|
-
*
|
|
137
|
-
* @param dst The buffer to read the audio into.
|
|
138
|
-
* @returns The number of samples read. If the source is closed, this will be
|
|
139
|
-
* less than the length of the provided buffer.
|
|
140
|
-
*/
|
|
141
|
-
read(dst) {
|
|
142
|
-
return __async(this, null, function* () {
|
|
143
|
-
const targetReadIndex = __privateGet(this, _readIndex) + dst.length;
|
|
144
|
-
while (!__privateGet(this, _closed) && targetReadIndex > __privateGet(this, _writeIndex)) {
|
|
145
|
-
yield __privateGet(this, _emitter).emit("wait");
|
|
146
|
-
yield Promise.race([
|
|
147
|
-
__privateGet(this, _emitter).once("enqueue"),
|
|
148
|
-
__privateGet(this, _emitter).once("close")
|
|
149
|
-
]);
|
|
150
|
-
yield __privateGet(this, _emitter).emit("read");
|
|
151
|
-
}
|
|
152
|
-
const read = Math.min(dst.length, __privateGet(this, _writeIndex) - __privateGet(this, _readIndex));
|
|
153
|
-
dst.set(__privateGet(this, _buffer).subarray(__privateGet(this, _readIndex), __privateGet(this, _readIndex) + read));
|
|
154
|
-
__privateSet(this, _readIndex, __privateGet(this, _readIndex) + read);
|
|
155
|
-
return read;
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Seek in the buffer.
|
|
160
|
-
*
|
|
161
|
-
* @param offset The offset to seek to.
|
|
162
|
-
* @param whence The position to seek from.
|
|
163
|
-
* @returns The new position in the buffer.
|
|
164
|
-
* @throws {Error} If the seek is invalid.
|
|
165
|
-
*/
|
|
166
|
-
seek(offset, whence) {
|
|
167
|
-
return __async(this, null, function* () {
|
|
168
|
-
let position = __privateGet(this, _readIndex);
|
|
169
|
-
switch (whence) {
|
|
170
|
-
case "start":
|
|
171
|
-
position = offset;
|
|
172
|
-
break;
|
|
173
|
-
case "current":
|
|
174
|
-
position += offset;
|
|
175
|
-
break;
|
|
176
|
-
case "end":
|
|
177
|
-
position = __privateGet(this, _writeIndex) + offset;
|
|
178
|
-
break;
|
|
179
|
-
default:
|
|
180
|
-
throw new Error(`Invalid seek mode: ${whence}`);
|
|
181
|
-
}
|
|
182
|
-
if (position < 0 || position > __privateGet(this, _writeIndex)) {
|
|
183
|
-
throw new Error("Seek out of bounds");
|
|
184
|
-
}
|
|
185
|
-
__privateSet(this, _readIndex, position);
|
|
186
|
-
return position;
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Get the number of samples in a given duration.
|
|
191
|
-
*
|
|
192
|
-
* @param durationSecs The duration in seconds.
|
|
193
|
-
* @returns The number of samples.
|
|
194
|
-
*/
|
|
195
|
-
durationToSampleCount(durationSecs) {
|
|
196
|
-
return Math.trunc(durationSecs * __privateGet(this, _sampleRate));
|
|
197
|
-
}
|
|
198
|
-
get buffer() {
|
|
199
|
-
return __privateGet(this, _buffer);
|
|
200
|
-
}
|
|
201
|
-
get readIndex() {
|
|
202
|
-
return __privateGet(this, _readIndex);
|
|
203
|
-
}
|
|
204
|
-
get writeIndex() {
|
|
205
|
-
return __privateGet(this, _writeIndex);
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Close the source. This signals that no more audio will be enqueued.
|
|
209
|
-
*
|
|
210
|
-
* This will emit a "close" event.
|
|
211
|
-
*
|
|
212
|
-
* @returns A promise that resolves when the source is closed.
|
|
213
|
-
*/
|
|
214
|
-
close() {
|
|
215
|
-
return __async(this, null, function* () {
|
|
216
|
-
__privateSet(this, _closed, true);
|
|
217
|
-
yield __privateGet(this, _emitter).emit("close");
|
|
218
|
-
__privateGet(this, _emitter).clearListeners();
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
_emitter = new WeakMap();
|
|
223
|
-
_buffer = new WeakMap();
|
|
224
|
-
_readIndex = new WeakMap();
|
|
225
|
-
_writeIndex = new WeakMap();
|
|
226
|
-
_closed = new WeakMap();
|
|
227
|
-
_sampleRate = new WeakMap();
|
|
228
|
-
_encoding = new WeakMap();
|
|
229
|
-
_container = new WeakMap();
|
|
230
|
-
_Source_instances = new WeakSet();
|
|
231
|
-
/**
|
|
232
|
-
* Create a new buffer for the source.
|
|
233
|
-
*
|
|
234
|
-
* @param size - The size of the buffer to create.
|
|
235
|
-
* @returns The new buffer as a TypedArray based on the encoding.
|
|
236
|
-
*/
|
|
237
|
-
createBuffer_fn = function(size) {
|
|
238
|
-
const { arrayType: ArrayType } = ENCODING_MAP[__privateGet(this, _encoding)];
|
|
239
|
-
return new ArrayType(size);
|
|
240
|
-
};
|
|
241
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
242
|
-
0 && (module.exports = {
|
|
243
|
-
ENCODING_MAP
|
|
244
|
-
});
|
package/dist/tts/source.js
DELETED
package/dist/tts/utils.cjs
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/tts/utils.ts
|
|
31
|
-
var utils_exports = {};
|
|
32
|
-
__export(utils_exports, {
|
|
33
|
-
base64ToArray: () => base64ToArray,
|
|
34
|
-
createMessageHandlerForContextId: () => createMessageHandlerForContextId,
|
|
35
|
-
filterSentinel: () => filterSentinel,
|
|
36
|
-
getEmitteryCallbacks: () => getEmitteryCallbacks,
|
|
37
|
-
getSentinel: () => getSentinel,
|
|
38
|
-
isComplete: () => isComplete,
|
|
39
|
-
isSentinel: () => isSentinel,
|
|
40
|
-
playAudioBuffer: () => playAudioBuffer
|
|
41
|
-
});
|
|
42
|
-
module.exports = __toCommonJS(utils_exports);
|
|
43
|
-
var import_base64_js = __toESM(require("base64-js"), 1);
|
|
44
|
-
|
|
45
|
-
// src/tts/source.ts
|
|
46
|
-
var import_emittery = __toESM(require("emittery"), 1);
|
|
47
|
-
var ENCODING_MAP = {
|
|
48
|
-
pcm_f32le: { arrayType: Float32Array, bytesPerElement: 4 },
|
|
49
|
-
pcm_s16le: { arrayType: Int16Array, bytesPerElement: 2 },
|
|
50
|
-
pcm_alaw: { arrayType: Uint8Array, bytesPerElement: 1 },
|
|
51
|
-
pcm_mulaw: { arrayType: Uint8Array, bytesPerElement: 1 }
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
// src/tts/utils.ts
|
|
55
|
-
function base64ToArray(b64, encoding) {
|
|
56
|
-
const byteArrays = filterSentinel(b64).map((b) => import_base64_js.default.toByteArray(b));
|
|
57
|
-
const { arrayType: ArrayType, bytesPerElement } = ENCODING_MAP[encoding];
|
|
58
|
-
const totalLength = byteArrays.reduce(
|
|
59
|
-
(acc, arr) => acc + arr.length / bytesPerElement,
|
|
60
|
-
0
|
|
61
|
-
);
|
|
62
|
-
const result = new ArrayType(totalLength);
|
|
63
|
-
let offset = 0;
|
|
64
|
-
for (const arr of byteArrays) {
|
|
65
|
-
const floats = new ArrayType(arr.buffer);
|
|
66
|
-
result.set(floats, offset);
|
|
67
|
-
offset += floats.length;
|
|
68
|
-
}
|
|
69
|
-
return result;
|
|
70
|
-
}
|
|
71
|
-
function playAudioBuffer(floats, context, startAt, sampleRate) {
|
|
72
|
-
const source = context.createBufferSource();
|
|
73
|
-
const buffer = context.createBuffer(1, floats.length, sampleRate);
|
|
74
|
-
buffer.getChannelData(0).set(floats);
|
|
75
|
-
source.buffer = buffer;
|
|
76
|
-
source.connect(context.destination);
|
|
77
|
-
source.start(startAt);
|
|
78
|
-
return new Promise((resolve) => {
|
|
79
|
-
source.onended = () => {
|
|
80
|
-
resolve();
|
|
81
|
-
};
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
function createMessageHandlerForContextId(contextId, handler) {
|
|
85
|
-
return (event) => {
|
|
86
|
-
if (typeof event.data !== "string") {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
const message = JSON.parse(event.data);
|
|
90
|
-
if (message.context_id !== contextId) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
let chunk;
|
|
94
|
-
if (message.done) {
|
|
95
|
-
chunk = getSentinel();
|
|
96
|
-
} else if (message.type === "chunk") {
|
|
97
|
-
chunk = message.data;
|
|
98
|
-
}
|
|
99
|
-
handler({ chunk, message: event.data, data: message });
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
function getSentinel() {
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
function isSentinel(x) {
|
|
106
|
-
return x === getSentinel();
|
|
107
|
-
}
|
|
108
|
-
function filterSentinel(collection) {
|
|
109
|
-
return collection.filter(
|
|
110
|
-
(x) => !isSentinel(x)
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
function isComplete(chunks) {
|
|
114
|
-
return isSentinel(chunks[chunks.length - 1]);
|
|
115
|
-
}
|
|
116
|
-
function getEmitteryCallbacks(emitter) {
|
|
117
|
-
return {
|
|
118
|
-
on: emitter.on.bind(emitter),
|
|
119
|
-
off: emitter.off.bind(emitter),
|
|
120
|
-
once: emitter.once.bind(emitter),
|
|
121
|
-
events: emitter.events.bind(emitter)
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
125
|
-
0 && (module.exports = {
|
|
126
|
-
base64ToArray,
|
|
127
|
-
createMessageHandlerForContextId,
|
|
128
|
-
filterSentinel,
|
|
129
|
-
getEmitteryCallbacks,
|
|
130
|
-
getSentinel,
|
|
131
|
-
isComplete,
|
|
132
|
-
isSentinel,
|
|
133
|
-
playAudioBuffer
|
|
134
|
-
});
|
package/dist/tts/utils.d.cts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import emittery__default from 'emittery';
|
|
2
|
-
import { Chunk, TypedArray, WebSocketResponse, Sentinel, EmitteryCallbacks } from '../types/index.cjs';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Convert base64-encoded audio buffer(s) to a TypedArray.
|
|
6
|
-
*
|
|
7
|
-
* @param b64 The base64-encoded audio buffer, or an array of base64-encoded
|
|
8
|
-
* audio buffers.
|
|
9
|
-
* @param encoding The encoding of the audio buffer(s).
|
|
10
|
-
* @returns The audio buffer(s) as a TypedArray.
|
|
11
|
-
*/
|
|
12
|
-
declare function base64ToArray(b64: Chunk[], encoding: string): TypedArray;
|
|
13
|
-
/**
|
|
14
|
-
* Schedule an audio buffer to play at a given time in the passed context.
|
|
15
|
-
*
|
|
16
|
-
* @param floats The audio buffer to play.
|
|
17
|
-
* @param context The audio context to play the buffer in.
|
|
18
|
-
* @param startAt The time to start playing the buffer at.
|
|
19
|
-
* @param sampleRate The sample rate of the audio.
|
|
20
|
-
* @returns A promise that resolves when the audio has finished playing.
|
|
21
|
-
*/
|
|
22
|
-
declare function playAudioBuffer(floats: Float32Array, context: AudioContext, startAt: number, sampleRate: number): Promise<void>;
|
|
23
|
-
/**
|
|
24
|
-
* Unwraps a chunk of audio data from a message event and calls the
|
|
25
|
-
* handler with it if the context ID matches.
|
|
26
|
-
*
|
|
27
|
-
* @param contextId The context ID to listen for.
|
|
28
|
-
* @param handler The handler to call with the chunk of audio data.
|
|
29
|
-
* @returns A message event handler.
|
|
30
|
-
*/
|
|
31
|
-
declare function createMessageHandlerForContextId(contextId: string, handler: ({ chunk, message, }: {
|
|
32
|
-
chunk?: Chunk;
|
|
33
|
-
message: string;
|
|
34
|
-
data: WebSocketResponse;
|
|
35
|
-
}) => void): (event: MessageEvent) => void;
|
|
36
|
-
/**
|
|
37
|
-
* Get a sentinel value that indicates the end of a stream.
|
|
38
|
-
* @returns A sentinel value to indicate the end of a stream.
|
|
39
|
-
*/
|
|
40
|
-
declare function getSentinel(): Sentinel;
|
|
41
|
-
/**
|
|
42
|
-
* Check if a chunk is a sentinel value (i.e. null).
|
|
43
|
-
*
|
|
44
|
-
* @param chunk
|
|
45
|
-
* @returns Whether the chunk is a sentinel value.
|
|
46
|
-
*/
|
|
47
|
-
declare function isSentinel(x: unknown): x is Sentinel;
|
|
48
|
-
/**
|
|
49
|
-
* Filter out null values from a collection.
|
|
50
|
-
*
|
|
51
|
-
* @param collection The collection to filter.
|
|
52
|
-
* @returns The collection with null values removed.
|
|
53
|
-
*/
|
|
54
|
-
declare function filterSentinel<T>(collection: T[]): Exclude<T, Sentinel>[];
|
|
55
|
-
/**
|
|
56
|
-
* Check if an array of chunks is complete by testing if the last chunk is a sentinel
|
|
57
|
-
* value (i.e. null).
|
|
58
|
-
* @param chunk
|
|
59
|
-
* @returns Whether the array of chunks is complete.
|
|
60
|
-
*/
|
|
61
|
-
declare function isComplete(chunks: Chunk[]): boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Get user-facing emitter callbacks for an Emittery instance.
|
|
64
|
-
* @param emitter The Emittery instance to get callbacks for.
|
|
65
|
-
* @returns User-facing emitter callbacks.
|
|
66
|
-
*/
|
|
67
|
-
declare function getEmitteryCallbacks<T>(emitter: emittery__default<T>): EmitteryCallbacks<T>;
|
|
68
|
-
|
|
69
|
-
export { base64ToArray, createMessageHandlerForContextId, filterSentinel, getEmitteryCallbacks, getSentinel, isComplete, isSentinel, playAudioBuffer };
|