realcoloride/node_characterai

Any way to retrieve the voice message from the character.ai response?

Closed this issue · 3 comments

I mean this in the character.ai text, just above the text bubble there's a button to play audio with the voice of the picked character. On click there's an event in the network tab (replay) "/multimodal/api/v1/memo/replay", in the response itself there's a link to a temporarily stored mp3 file with some kind of tokenization "https://storage.googleapis.com/character-ai-multimodal-memo/voice_generated/". I tried to look up similar issues but I've only found the references of a call, not text-driven audio response.
66

Hello, this is a feature that has been implemented in the 2.0 branch, but it is currently in work.
The 1.1+ versions are currently not worked on anymore and all work has shifted to the 2.0 branch.

#180
https://github.com/realcoloride/node_characterai/blob/2.0/src/chat/message.ts#L301

Oh well, I unfortunately have no clue how to work with typescript by any means, so I guess I'll wait for a release of it, thanks.

At the moment I'm working intensively on it, but I appreciate your patience.
In the mean time, here is how you can do it yourself:
https://github.com/realcoloride/node_characterai/blob/2.0/src/chat/candidate.ts#L114

The endpoint is https://neo.character.ai/multimodal/api/v1/memo/replay, POST request,
make sure to include the following in your body:

            body: Parser.stringify({ 
                candidateId: this.candidateId,
                roomId: this.message.chatId,
                turnId: this.message.turnId,
                voiceId,
                voiceQuery
            }),

Hope this helps you out.

Cheers