Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: 불필요 주석 제거
  • Loading branch information
codejs-kr committed Aug 25, 2020
commit 1aece3f6d45323a8f49fa170d1e49785910fe7a5
28 changes: 3 additions & 25 deletions frontend/views/examples/speech-recognition/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ $(function () {

/**
* 음성 인식 종료 처리
* @returns {boolean}
*/
recognition.onend = function () {
console.log('onend', arguments);
Expand All @@ -60,7 +59,6 @@ $(function () {

/**
* 음성 인식 결과 처리
* @param event
*/
recognition.onresult = function (event) {
console.log('onresult', event);
Expand Down Expand Up @@ -91,7 +89,6 @@ $(function () {

/**
* 음성 인식 에러 처리
* @param event
*/
recognition.onerror = function (event) {
console.log('onerror', event);
Expand Down Expand Up @@ -145,17 +142,15 @@ $(function () {

/**
* 개행 처리
* @param s
* @returns {string}
* @param {string} s
*/
function linebreak(s) {
return s.replace(TWO_LINE, '<p></p>').replace(ONE_LINE, '<br>');
}

/**
* 첫문자를 대문자로 변환
* @param s
* @returns {string | void | *}
* @param {string} s
*/
function capitalize(s) {
return s.replace(FIRST_CHAR, function (m) {
Expand Down Expand Up @@ -187,7 +182,7 @@ $(function () {
function textToSpeech(text) {
console.log('textToSpeech', arguments);

// speechSynthesis option
// speechSynthesis options
// const u = new SpeechSynthesisUtterance();
// u.text = 'Hello world';
// u.lang = 'en-US';
Expand All @@ -201,23 +196,6 @@ $(function () {
speechSynthesis.speak(new SpeechSynthesisUtterance(text));
}

/**
* 미사용
* requestServer
* key - AIzaSyDiMqfg8frtoZflA_2LPqfGdpjmgTMgWhg
*/
function requestServer() {
$.ajax({
method: 'post',
url:
'https://www.google.com/speech-api/v2/recognize?output=json&lang=en-us&key=AIzaSyDiMqfg8frtoZflA_2LPqfGdpjmgTMgWhg',
data: '/examples/speech-recognition/hello.wav',
contentType: 'audio/l16; rate=16000;', // 'audio/x-flac; rate=44100;',
success: function (data) {},
error: function (xhr) {},
});
}

/**
* 초기 바인딩
*/
Expand Down