input='I won't be home tonight. Could you please take the dog for a walk?'
)
response.stream_to_file(speech_file_path)
이 스크립트는 디렉터리에
mp3
파일을 생성합니다.
MP3
외에도 세 가지 다른 오디오 포맷을
지원합니다.
●
opus
: 온라인 스트리밍과 커뮤니케이션에서 지연이 적도록 최적화된 포맷입니다.
●
aac
: 유튜브와 안드로이드 및
iOS
기기에서 디지털 오디오 압축을 위한 포맷입니다.
●
flac
: 무손실 오디오 압축 포맷입니다.
모든 매개변수의 세부 사항은 [표
2
-
10
]을 참고하세요.
표
2-10
텍스트 음성 변환 엔드포인트 입력의 설명
필드 이름유형설명
model
문자열(필수)
모델의
ID
입니다.
tts
-
1
과
tts
-
1
-
hd
가 있습니다(
2024
년
11
월).
input
문자열(필수)
오디오로 변환할 텍스트. 최대 길이는
4
,
096
자입니다.
voice
문자열(필수)
alloy
,
echo
,
fable
,
onyx
,
nova
,
shimmer
response
_
format
문자열(기본값:
mp3
)
mp3
, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.