네이버 클로버 tts
[code]
<?php
$client_id = "";
$client_secret = "";
$txt = $_GET['txt'];
if(!$txt) $txt = '텍스트 파라미터를 입력 바랍니다.';
$encText = urlencode($txt);
$postvars = "speaker=mijin&speed=0&text=".$encText;
$url = "https://openapi.naver.com/v1/voice/tts.bin";
$is_post = true;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, $is_post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_POSTFIELDS, $postvars);
$headers = array();
$headers[] = "X-Naver-Client-Id: ".$client_id;
$headers[] = "X-Naver-Client-Secret: ".$client_secret;
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec ($ch);
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close ($ch);
if($status_code == 200) {
header("Content-type: audio/mpeg");
header("Content-Transfer-Encoding: binary");
header('Pragma: no-cache');
header('Expires: 0');
echo $response;
} else {
echo "Error 내용:".$response;
}
[/code]
<?php
$client_id = "";
$client_secret = "";
$txt = $_GET['txt'];
if(!$txt) $txt = '텍스트 파라미터를 입력 바랍니다.';
$encText = urlencode($txt);
$postvars = "speaker=mijin&speed=0&text=".$encText;
$url = "https://openapi.naver.com/v1/voice/tts.bin";
$is_post = true;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, $is_post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_POSTFIELDS, $postvars);
$headers = array();
$headers[] = "X-Naver-Client-Id: ".$client_id;
$headers[] = "X-Naver-Client-Secret: ".$client_secret;
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec ($ch);
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close ($ch);
if($status_code == 200) {
header("Content-type: audio/mpeg");
header("Content-Transfer-Encoding: binary");
header('Pragma: no-cache');
header('Expires: 0');
echo $response;
} else {
echo "Error 내용:".$response;
}
[/code]
댓글 3개
terrorboy
8년 전
1일 제한 1만자
방구석기타리스트
7년 전
감사합니다~!
혹시... 반대는 없나요?
혹시... 반대는 없나요?
terrorboy
7년 전
아직 찾은게 없네요 ㅎㅎ
게시글 목록
| 번호 | 제목 |
|---|---|
| 15786 | |
| 15785 | |
| 15784 | |
| 15783 | |
| 15782 | |
| 15781 | |
| 15780 | |
| 15777 | |
| 15776 | |
| 15775 | |
| 15774 | |
| 15773 | |
| 15772 | |
| 15768 | |
| 15767 | |
| 15766 |
JavaScript
날짜 date 란?
1
|
| 15763 | |
| 15762 | |
| 15761 | |
| 15756 | |
| 15753 |
JavaScript
정규식으로 유투브 주소에서 아이디 값만 추출
|
| 15752 | |
| 15751 |
MySQL
MySQL 세자리 마다 콤마 찍기
1
|
| 15750 |
JavaScript
각 단어의 첫글자를 대문자로
|
| 15749 | |
| 15747 | |
| 15746 | |
| 15745 | |
| 15744 | |
| 15743 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기