이재호

Merge branch 'feature/output_audio' into 'master'

Feature/output audio

add output audio

See merge request !2
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
1 +curl -v -X POST "https://kakaoi-newtone-openapi.kakao.com/v1/synthesize" \
2 +-H "Content-Type: application/xml" \
3 +-H "Authorization: KakaoAK b471fd473a02136533554c3c6c108c91" \
4 +-d '<speak><voice name="WOMAN_READ_CALM">정상</voice> </speak>' > 0.mp3
5 +
6 +curl -v -X POST "https://kakaoi-newtone-openapi.kakao.com/v1/synthesize" \
7 +-H "Content-Type: application/xml" \
8 +-H "Authorization: KakaoAK b471fd473a02136533554c3c6c108c91" \
9 +-d '<speak><voice name="WOMAN_READ_CALM">미착용</voice></speak>' > 1.mp3
10 +
11 +curl -v -X POST "https://kakaoi-newtone-openapi.kakao.com/v1/synthesize" \
12 +-H "Content-Type: application/xml" \
13 +-H "Authorization: KakaoAK b471fd473a02136533554c3c6c108c91" \
14 +-d '<speak><voice name="WOMAN_READ_CALM">턱스크</voice></speak>' > 2.mp3
15 +
16 +curl -v -X POST "https://kakaoi-newtone-openapi.kakao.com/v1/synthesize" \
17 +-H "Content-Type: application/xml" \
18 +-H "Authorization: KakaoAK b471fd473a02136533554c3c6c108c91" \
19 +-d '<speak><voice name="WOMAN_READ_CALM">입스크</voice></speak>' > 3.mp3
20 +
21 +curl -v -X POST "https://kakaoi-newtone-openapi.kakao.com/v1/synthesize" \
22 +-H "Content-Type: application/xml" \
23 +-H "Authorization: KakaoAK b471fd473a02136533554c3c6c108c91" \
24 +-d '<speak><voice name="WOMAN_READ_CALM">시작</voice> </speak>' > 4.mp3
...@@ -13,7 +13,8 @@ router.get('/data', function(req, res, next){ ...@@ -13,7 +13,8 @@ router.get('/data', function(req, res, next){
13 id = req.query.id; 13 id = req.query.id;
14 14
15 data = { 15 data = {
16 - image : "/images/"+id+".jpg" 16 + image : "/images/"+id+".jpg",
17 + audio : "/audio/"+id+".mp3"
17 } 18 }
18 //데이터 확인 19 //데이터 확인
19 console.log(data); 20 console.log(data);
......
...@@ -16,7 +16,11 @@ ...@@ -16,7 +16,11 @@
16 <div id="check_image"> 16 <div id="check_image">
17 <img src="/images/1.jpg"> 17 <img src="/images/1.jpg">
18 </div> 18 </div>
19 - 19 + <div id = "check_audio">
20 + <!--초기값으로 '시작'이라는 음성을 사용 -->
21 + <!--auto play 기능을 위해 iframe 사용 -->
22 + <iframe src="/audios/4.mp3" allow="autoplay" id="audio" style="display:none"></iframe>
23 + </div>
20 <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.3.1/dist/tf.min.js"></script> 24 <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.3.1/dist/tf.min.js"></script>
21 <script src="https://cdn.jsdelivr.net/npm/@teachablemachine/image@0.8/dist/teachablemachine-image.min.js"></script> 25 <script src="https://cdn.jsdelivr.net/npm/@teachablemachine/image@0.8/dist/teachablemachine-image.min.js"></script>
22 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> 26 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
...@@ -127,12 +131,16 @@ ...@@ -127,12 +131,16 @@
127 function process_json(json_data){ 131 function process_json(json_data){
128 var images = json_data.image; 132 var images = json_data.image;
129 var strDOM = ""; 133 var strDOM = "";
130 - 134 + var audio = json_data.audio;
135 + var audioName = "";
131 //이미지 태그 생성 136 //이미지 태그 생성
132 strDOM += '<img src="'+images+'">'; 137 strDOM += '<img src="'+images+'">';
133 - 138 + //오디오 태그 생성
139 + audioName += '<iframe src="' + audio + '" allow="autoplay" id="audio" style="display:none"></iframe>';
134 //#cehck_image div의 이미지 교체 140 //#cehck_image div의 이미지 교체
135 $('#check_image').html(strDOM); 141 $('#check_image').html(strDOM);
142 + //#check_audio div의 오디오 교체
143 + $('#check_audio').html(audioName);
136 } 144 }
137 145
138 </script> 146 </script>
......