From 3913f2558dcf71aa268cb1a25a60c55c8119ea50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=97=8D+85CD?= <50108258+kwaa@users.noreply.github.com> Date: Thu, 9 Jan 2025 21:00:33 +0800 Subject: [PATCH] chore: bump xsai, update speech params --- .../stage-ui/src/components/Widgets/Stage.vue | 5 +- pnpm-lock.yaml | 117 ++++++++---------- pnpm-workspace.yaml | 12 +- .../src/bots/discord/commands/summon.ts | 5 +- 4 files changed, 65 insertions(+), 74 deletions(-) diff --git a/packages/stage-ui/src/components/Widgets/Stage.vue b/packages/stage-ui/src/components/Widgets/Stage.vue index e91331b..d88f36f 100644 --- a/packages/stage-ui/src/components/Widgets/Stage.vue +++ b/packages/stage-ui/src/components/Widgets/Stage.vue @@ -77,15 +77,14 @@ const ttsQueue = useQueue({ baseURL: 'https://unspeech.hyp3r.link/v1/', }) const res = await generateSpeech({ - ...elevenlabs.speech({ - model: 'elevenlabs/eleven_multilingual_v2', - voice: voiceMap[voice], + ...elevenlabs.speech('elevenlabs/eleven_multilingual_v2', { voiceSettings: { stability: 0.4, similarityBoost: 0.5, }, }), input: ctx.data, + voice: voiceMap[voice], }) const elapsed = Date.now() - now diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dc73c04..5c6ab35 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,23 +7,23 @@ settings: catalogs: default: '@xsai/generate-speech': - specifier: ^0.0.24 - version: 0.0.24 + specifier: ^0.0.26 + version: 0.0.26 '@xsai/generate-text': - specifier: ^0.0.24 - version: 0.0.24 + specifier: ^0.0.26 + version: 0.0.26 '@xsai/model': - specifier: ^0.0.24 - version: 0.0.24 + specifier: ^0.0.26 + version: 0.0.26 '@xsai/providers': - specifier: ^0.0.24 - version: 0.0.24 + specifier: ^0.0.26 + version: 0.0.26 '@xsai/shared-chat': - specifier: ^0.0.24 - version: 0.0.24 + specifier: ^0.0.26 + version: 0.0.26 '@xsai/stream-text': - specifier: ^0.0.24 - version: 0.0.24 + specifier: ^0.0.26 + version: 0.0.26 importers: @@ -260,22 +260,22 @@ importers: version: 12.3.0(typescript@5.7.3) '@xsai/generate-speech': specifier: 'catalog:' - version: 0.0.24 + version: 0.0.26 '@xsai/generate-text': specifier: 'catalog:' - version: 0.0.24 + version: 0.0.26 '@xsai/model': specifier: 'catalog:' - version: 0.0.24 + version: 0.0.26 '@xsai/providers': specifier: 'catalog:' - version: 0.0.24 + version: 0.0.26 '@xsai/shared-chat': specifier: 'catalog:' - version: 0.0.24 + version: 0.0.26 '@xsai/stream-text': specifier: 'catalog:' - version: 0.0.24 + version: 0.0.26 defu: specifier: ^6.1.4 version: 6.1.4 @@ -548,22 +548,22 @@ importers: version: 12.3.0(typescript@5.7.3) '@xsai/generate-speech': specifier: 'catalog:' - version: 0.0.24 + version: 0.0.26 '@xsai/generate-text': specifier: 'catalog:' - version: 0.0.24 + version: 0.0.26 '@xsai/model': specifier: 'catalog:' - version: 0.0.24 + version: 0.0.26 '@xsai/providers': specifier: 'catalog:' - version: 0.0.24 + version: 0.0.26 '@xsai/shared-chat': specifier: 'catalog:' - version: 0.0.24 + version: 0.0.26 '@xsai/stream-text': specifier: 'catalog:' - version: 0.0.24 + version: 0.0.26 defu: specifier: ^6.1.4 version: 6.1.4 @@ -799,16 +799,16 @@ importers: version: 3.2.4 '@xsai/generate-speech': specifier: 'catalog:' - version: 0.0.24 + version: 0.0.26 '@xsai/generate-text': specifier: 'catalog:' - version: 0.0.24 + version: 0.0.26 '@xsai/providers': specifier: 'catalog:' - version: 0.0.24 + version: 0.0.26 '@xsai/shared-chat': specifier: 'catalog:' - version: 0.0.24 + version: 0.0.26 discord.js: specifier: ^14.17.3 version: 14.17.3 @@ -4071,29 +4071,26 @@ packages: resolution: {integrity: sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==} engines: {node: '>=10.0.0'} - '@xsai/generate-speech@0.0.24': - resolution: {integrity: sha512-W5uNBX1D5ZMdkO+Jb9xGnJokSk/ubtm5AkaNa8YWi+biCl4nx/2XRxMJH059I/cpH+G1ueBrGsJxBYC4ZwVXDQ==} + '@xsai/generate-speech@0.0.26': + resolution: {integrity: sha512-sYYPzBFKvAjq3pGyTy0o5Yde8f1WmuIbf9C9gfij42Cur5+6XSWqqYnh8qhJSkuwxyemKapVN1cEpl2zivqpJw==} - '@xsai/generate-text@0.0.24': - resolution: {integrity: sha512-jUKhC+vv8y5XE91pazzU1idLnmydW6UVhP8gJFVG8e6RbFypTD5d2Xf3wBVDbFJe7adoyLrL2APgcxZzQ3WJQQ==} + '@xsai/generate-text@0.0.26': + resolution: {integrity: sha512-NqyuzgE6dFEsBegCbMUzCWdAsnEdOmX/wVWKlwlNCtPXPsHaejmuJ8e5+1IyZ2J/Kh4x64TevurGffKjUvjTmQ==} - '@xsai/model@0.0.24': - resolution: {integrity: sha512-/2SOgQMHa+lmYFp2GLJnMGhMIYkC/pgh6wAA6bcDKUhEI52PUJZCtzE+xV4PEoC1lq5Mzw0W1V0ZMDgcCgZ0xA==} + '@xsai/model@0.0.26': + resolution: {integrity: sha512-ihzTqjc48Niucj5Xthu8uSXjoJEs+DatYOeFYPYCInpHxJ3E5Qlrx0RingjIu40lJOcb1hDRbKkk3D6CCAg3jA==} - '@xsai/providers@0.0.24': - resolution: {integrity: sha512-bZisxprgEwsUqvTJZphfbNXi8ZisGdyJUH4ik5joGIqCW6yBQNtUSlRJLTw6Ej6Mx6WjaOTZC9PKUZuUDEGvsg==} + '@xsai/providers@0.0.26': + resolution: {integrity: sha512-O+Mz/A7wdmRolxVS6nVclbOQWQfAPBlQocfNRwMAWKk4kutD+bt9CcvriPyYQVxumV/8bWELnFpnSmtoSZoeFA==} - '@xsai/shared-chat@0.0.24': - resolution: {integrity: sha512-27sW2f5ev2J4A137yinkdZnhuRP3HR2u1BsMV2ZzbGzYUwpfZnctI0tZgeG3CRz9TG22o+MRaUOLeGoBhC+fag==} + '@xsai/shared-chat@0.0.26': + resolution: {integrity: sha512-kwinIDaKcU4ND/3dmmjh51UGP147soHq2EDgNjJ/a9oP41RM1VkJGmBBJMMMMewLqrVEsUxZB4KlFgWZ5KJqWA==} - '@xsai/shared-chat@0.0.25': - resolution: {integrity: sha512-B7uxYAzfGz+3Mldx2BsOQ9vRl8hjA2kUoM2YZUFYpwZ4CFnmYrqXcvoOJRpA+Vb34L/Yp6x081zPI1BAaN1kKg==} + '@xsai/shared@0.0.26': + resolution: {integrity: sha512-x+xcG9zuSGiO/g8Cg+wQnaUQi6CpcEFY64BnNUBknwZQD/Ue8Av/OOcSJ8RVS5WPE4/G+yQd4HSOuayp86uECA==} - '@xsai/shared@0.0.25': - resolution: {integrity: sha512-bSD2EvYkvglvINvorq9Jvyn2X/vFmeFp+UHCEWhrcFSiuFvAhYsM0DVjMJu3qS/W5nBJ+fTN5YVNYd47MpmCdA==} - - '@xsai/stream-text@0.0.24': - resolution: {integrity: sha512-2Focgo62pKPpSgJ6PkHFZ2gP4vUBdjhSU1DRrHf9nR5kp/lWmyi3bNl0T/Cl59139kW5V5sTNXNfLb9mumXkKQ==} + '@xsai/stream-text@0.0.26': + resolution: {integrity: sha512-Thm2gC2nBMV3/bEt1C9Efa88aWqtOpjzBIwt9/7gLXwOGLwYU3dt5h3OMXFD32D9dFaLyR4B8+M8UCJpXZDqIQ==} abbrev@1.1.1: resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} @@ -12663,35 +12660,31 @@ snapshots: '@xmldom/xmldom@0.8.10': {} - '@xsai/generate-speech@0.0.24': - dependencies: - '@xsai/shared': 0.0.25 - - '@xsai/generate-text@0.0.24': + '@xsai/generate-speech@0.0.26': dependencies: - '@xsai/shared-chat': 0.0.25 + '@xsai/shared': 0.0.26 - '@xsai/model@0.0.24': + '@xsai/generate-text@0.0.26': dependencies: - '@xsai/shared': 0.0.25 + '@xsai/shared-chat': 0.0.26 - '@xsai/providers@0.0.24': + '@xsai/model@0.0.26': dependencies: - '@xsai/shared': 0.0.25 + '@xsai/shared': 0.0.26 - '@xsai/shared-chat@0.0.24': + '@xsai/providers@0.0.26': dependencies: - '@xsai/shared': 0.0.25 + '@xsai/shared': 0.0.26 - '@xsai/shared-chat@0.0.25': + '@xsai/shared-chat@0.0.26': dependencies: - '@xsai/shared': 0.0.25 + '@xsai/shared': 0.0.26 - '@xsai/shared@0.0.25': {} + '@xsai/shared@0.0.26': {} - '@xsai/stream-text@0.0.24': + '@xsai/stream-text@0.0.26': dependencies: - '@xsai/shared-chat': 0.0.25 + '@xsai/shared-chat': 0.0.26 abbrev@1.1.1: optional: true diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 8dbeba1..769da7c 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -5,9 +5,9 @@ packages: - '!**/dist/**' catalog: - '@xsai/generate-speech': ^0.0.24 - '@xsai/generate-text': ^0.0.24 - '@xsai/model': ^0.0.24 - '@xsai/providers': ^0.0.24 - '@xsai/shared-chat': ^0.0.24 - '@xsai/stream-text': ^0.0.24 + '@xsai/generate-speech': ^0.0.26 + '@xsai/generate-text': ^0.0.26 + '@xsai/model': ^0.0.26 + '@xsai/providers': ^0.0.26 + '@xsai/shared-chat': ^0.0.26 + '@xsai/stream-text': ^0.0.26 diff --git a/services/discord-voice-bot/src/bots/discord/commands/summon.ts b/services/discord-voice-bot/src/bots/discord/commands/summon.ts index f39974d..dfc9bfe 100644 --- a/services/discord-voice-bot/src/bots/discord/commands/summon.ts +++ b/services/discord-voice-bot/src/bots/discord/commands/summon.ts @@ -155,15 +155,14 @@ export async function handleSummon(log: ReturnType, interaction: }) const speechRes = await generateSpeech({ - ...elevenlabs.speech({ - model: 'eleven_multilingual_v2', - voice: 'lNxY9WuCBCZCISASyJ55', + ...elevenlabs.speech('eleven_multilingual_v2', { voiceSettings: { stability: 0.4, similarityBoost: 0.5, }, }), input: res.text, + voice: 'lNxY9WuCBCZCISASyJ55', }) log.withField('length', speechRes.byteLength).log('Generated speech')