mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-04 08:30:39 +00:00
docs: add ai-voice-changer playground example (#2708)
This commit is contained in:
@@ -169,6 +169,12 @@ const examples = [
|
||||
slug: 'ai-txt2speech-elevenlabs',
|
||||
source: '/playground/examples/ai-txt2speech-elevenlabs.html',
|
||||
},
|
||||
{
|
||||
title: 'Voice Changer',
|
||||
description: 'Swap a sample clip into a new voice using Puter.js AI speech-to-speech helpers.',
|
||||
slug: 'ai-voice-changer',
|
||||
source: '/playground/examples/ai-voice-changer.html',
|
||||
},
|
||||
{
|
||||
title: 'ElevenLabs Voice changer with a sample clip',
|
||||
description: 'Transform an audio clip into a new voice using Puter.js speech-to-speech helper.',
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<html>
|
||||
<body>
|
||||
<script src="https://js.puter.com/v2/"></script>
|
||||
<button id="swap">Convert voice</button>
|
||||
<script>
|
||||
document.getElementById('swap').addEventListener('click', async ()=>{
|
||||
const audio = await puter.ai.speech2speech(
|
||||
'https://puter-sample-data.puter.site/tts_example.mp3',
|
||||
{
|
||||
voice: '21m00Tcm4TlvDq8ikWAM',
|
||||
model: 'eleven_multilingual_sts_v2',
|
||||
output_format: 'mp3_44100_128'
|
||||
}
|
||||
);
|
||||
audio.play();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user