Toggle navigation
Toggle navigation
This project
Loading...
Sign in
민병수
/
Voicoding
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
천현우
2021-05-28 01:45:02 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
80c23fcb841a00ee9e367134a1d0dad5f1de4fce
80c23fcb
1 parent
ca348666
voicoding update
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletions
voicoding.js
voicoding.js
View file @
80c23fc
...
...
@@ -3,6 +3,7 @@ const recorder = require('node-record-lpcm16');
// Imports the Google Cloud client library
const
speech
=
require
(
'@google-cloud/speech'
);
// Creates a client
const
client
=
new
speech
.
SpeechClient
();
...
...
@@ -12,12 +13,40 @@ const client = new speech.SpeechClient();
const
encoding
=
'LINEAR16'
;
const
sampleRateHertz
=
16000
;
const
languageCode
=
'ko-KR'
;
const
speechContexts
=
[{
phrases
:
[
'$OOV_CLASS_ALPHA_SEQUENCE 는 $OOV_CLASS_ALPHA_SEQUENCE'
,
'$OOV_CLASS_ALPHA_SEQUENCE 는 $OOV_CLASS_DIGIT_SEQUENCE'
,
'$OOV_CLASS_ALPHA_SEQUENCE 는 $OOV_CLASS_ALPHA_SEQUENCE 보다 크다'
,
'$OOV_CLASS_ALPHA_SEQUENCE 는 $OOV_CLASS_ALPHA_SEQUENCE 보다 작다'
,
'$OOV_CLASS_ALPHA_SEQUENCE 는 $OOV_CLASS_DIGIT_SEQUENCE 보다 크다'
,
'$OOV_CLASS_ALPHA_SEQUENCE 는 $OOV_CLASS_DIGIT_SEQUENCE 보다 작다'
,
'for OOV_CLASS_ALPHA_SEQUENCE in range $OOV_CLASS_DIGIT_SEQUENCE'
,
'if'
,
'이프'
,
'else if'
,
'엘스 이프'
,
'else'
,
'엘스'
,
'while'
,
'와일'
,
'함수'
,
'파라미터'
,
'parameter'
,
'변수 선언'
,
'함수 선언'
,
'반복문 선언'
,
'조건문 선언'
],
boost
:
20
}]
const
request
=
{
config
:
{
encoding
:
encoding
,
sampleRateHertz
:
sampleRateHertz
,
languageCode
:
languageCode
languageCode
:
languageCode
,
alternativeLanguageCodes
:
[
'en-US'
],
speechContexts
:
speechContexts
},
interimResults
:
false
,
// If you want interim results, set this to true
};
...
...
Please
register
or
login
to post a comment