Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이준성
/
khuwitch
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
Jinsu Park
2020-12-06 23:21:01 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
24b8f503778901f2c369250dfa426e85122f1827
24b8f503
1 parent
80d0a66b
Index.html이 아닌 node 단에서 aws-sdk 설치
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
2 deletions
frontend/package-lock.json
frontend/package.json
frontend/public/index.html
frontend/src/tts.js
server/package.json
frontend/package-lock.json
View file @
24b8f50
This diff could not be displayed because it is too large.
frontend/package.json
View file @
24b8f50
...
...
@@ -8,9 +8,11 @@
"@testing-library/jest-dom"
:
"^5.11.4"
,
"@testing-library/react"
:
"^11.1.0"
,
"@testing-library/user-event"
:
"^12.1.10"
,
"aws-sdk"
:
"^2.804.0"
,
"react"
:
"^17.0.1"
,
"react-dom"
:
"^17.0.1"
,
"react-scripts"
:
"4.0.1"
,
"socket.io-client"
:
"^3.0.3"
,
"web-vitals"
:
"^0.2.4"
},
"scripts"
:
{
...
...
frontend/public/index.html
View file @
24b8f50
...
...
@@ -25,8 +25,6 @@
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>
Khuwitch
</title>
<script
src=
"https://sdk.amazonaws.com/js/aws-sdk-2.796.0.min.js"
></script>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
...
...
frontend/src/tts.js
0 → 100644
View file @
24b8f50
import
AWS
from
'aws-sdk'
// Polly를 사용하기 위한 자격증명을 설정한다.
AWS
.
config
.
region
=
'ap-northeast-2'
;
AWS
.
config
.
credentials
=
new
AWS
.
CognitoIdentityCredentials
({
IdentityPoolId
:
'ap-northeast-2:03db97c9-a857-45f3-be6e-3cf84d6f619b'
});
const
polly
=
new
AWS
.
Polly
({
signatureVersion
:
'v4'
,
region
:
'ap-northeast-2'
,
});
function
speak
(
text
){
let
params
=
{
'Text'
:
text
,
'OutputFormat'
:
'mp3'
,
'VoiceId'
:
'Seoyeon'
};
let
tts
=
new
AWS
.
Polly
.
Presigner
(
params
,
polly
)
// tts로 변환한 음성 파일을 얻는다.
tts
.
getSynthesizeSpeechUrl
(
params
,
function
(
error
,
url
)
{
if
(
error
)
{
}
else
{
setTimeout
(()
=>
{
console
.
log
(
"실행"
)
let
audio
=
new
Audio
(
url
)
audio
.
play
()
// .then(delete audio);
},
3000
)
}
})
}
export
default
{
"speak"
:
speak
,
}
server/package.json
View file @
24b8f50
...
...
@@ -10,6 +10,7 @@
"author"
:
"Daeyeonkim97"
,
"license"
:
"ISC"
,
"dependencies"
:
{
"cors"
:
"^2.8.5"
,
"dotenv"
:
"^8.2.0"
,
"ejs"
:
"^3.1.5"
,
"express"
:
"^4.17.1"
,
...
...
Please
register
or
login
to post a comment