0%
0Hz
예시 문장:
⚡ API 사용법 Guide
Cloudflare Pages 배포 후 어디서나 HTTP GET 또는 POST 요청으로 음성을 받아올 수 있습니다.
GET 방식 (HTML audio src에 직접 바인딩 가능)
<audio src="https://<your-domain>/api/tts?text=안녕하세요&voice=ko-KR-SunHiNeural" controls></audio>
POST 방식 (cURL / JavaScript fetch)
fetch('/api/tts', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
text: "안녕하세요, 클라우드플레어 엣지 TTS 테스트입니다.",
voice: "ko-KR-SunHiNeural",
rate: "+0%",
pitch: "+0Hz"
})
})
.then(res => res.blob())
.then(blob => {
const audioUrl = URL.createObjectURL(blob);
new Audio(audioUrl).play();
});