add dectalk tts for 25k channel points (let the suffering begin)

This commit is contained in:
2025-12-08 18:14:25 +01:00
parent eb5cca7897
commit 6a71806881
8 changed files with 64 additions and 20 deletions

View File

@@ -4,7 +4,7 @@ import { sendMessage } from "lib/commandUtils";
import { redis } from "lib/redis";
import { timeout } from "lib/timeout";
import type User from "user";
import { playTTS } from "web/alerts/serverFunctions";
import { playMSTTS } from "web/alerts/serverFunctions";
const ANIVNAMES: anivBots[] = ["a_n_e_e_v", "a_n_i_v"];
@@ -44,7 +44,7 @@ export default async function handleMessage(
user: User,
) {
if (ANIVNAMES.map((a) => a.toLowerCase()).includes(user.username)) {
await playTTS({ text: msg.messageText });
await playMSTTS({ text: msg.messageText });
const data: anivMessageStore = await redis
.get("anivmessages")
.then((a) => (a === null ? {} : JSON.parse(a)));

View File

@@ -0,0 +1,15 @@
import { sendMessage } from "lib/commandUtils";
import PointRedeem from "pointRedeems";
import { playDecTalk } from "web/alerts/serverFunctions";
export default new PointRedeem({
name: "dectalk",
cost: 25000,
title: "Dectalk TTS",
input: true,
prompt: "I HECKIN LOVE DECTALK TTS!!!",
async execution(msg) {
await playDecTalk(msg.input);
await sendMessage("LETSGO SUFFERING LETSGO");
},
});

View File

@@ -6,4 +6,9 @@ export type MSTTS = {
speed: string;
};
export type TTS = MSTTS;
export type DecTalk = {
type: "dectalk";
text: string;
};
export type TTS = MSTTS | DecTalk;

View File

@@ -12,14 +12,14 @@ export async function playAlert(alert: alert) {
});
}
type TTSOptions = {
type MSTTSOptions = {
text: string;
voice?: string;
pitch?: number;
speed?: number;
};
export async function playTTS(options: TTSOptions) {
export async function playMSTTS(options: MSTTSOptions) {
await sendAlertEvent({
function: "playTTS",
tts: {
@@ -32,6 +32,16 @@ export async function playTTS(options: TTSOptions) {
});
}
export async function playDecTalk(input: string) {
await sendAlertEvent({
function: "playTTS",
tts: {
type: "dectalk",
text: input,
},
});
}
export async function stopTTS() {
await sendAlertEvent({
function: "cancelTTS",

View File

@@ -30,6 +30,9 @@ class TTSManager {
`https://tetyys.com/SAPI4/SAPI4?text=${tts.text}&voice=${tts.voice}&pitch=${tts.pitch}&speed=${tts.speed}`,
);
break;
case "dectalk":
await this.playAudio(`http://tts.cyzon.us/tts?text=${tts.text}`);
break;
}
const newTTS = this.ttsQueue.shift();