Skip to content

Commit

Permalink
1.0.0 - Official release
Browse files Browse the repository at this point in the history
  • Loading branch information
OvidijusParsiunas committed Aug 23, 2023
1 parent 4df6420 commit 5ced207
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 32 deletions.
59 changes: 43 additions & 16 deletions component/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,53 @@
<head>
<meta charset="utf-8" />
<title>Speech To Element</title>
<script type="module" src="src/index.ts"></script>
<style>
html,
body {
height: 100%;
margin: 0px;
}
</style>
<link rel="stylesheet" href="indexStyle.css" />
<!-- Uncomment this when using Azure -->
<!-- <script src="https://aka.ms/csspeech/jsbrowserpackageraw"></script> -->
</head>
<body>
<div id="input-text" contenteditable="true" style="width: 300px; height: 20px; border: 1px solid grey"></div>
<input id="input-text-2" type="text" style="width: 300px; height: 20px; border: 1px solid grey" />
<textarea id="input-text-3" type="text" style="width: 300px; height: 20px; border: 1px solid grey"></textarea>
<button id="record-button">Record</button>
<h1 id="title">Speech To Element Development</h1>
<div id="text" contenteditable="true"></div>
<button id="button">Start</button>
<div id="error">Error, check the console for more details.</div>
<script type="module">
import SpeechToElement from './src/index';
const button = document.getElementById('record-button');
button.onclick = () => {
// const speechToInput = new SpeechToInput();
SpeechToElement.toggle({element: document.getElementById('input-text-3')});
const textEl = document.getElementById('text');
const buttonEl = document.getElementById('button');
const errorEl = document.getElementById('error');
buttonEl.onclick = () => {
errorEl.style.display = 'none';
// WebSpeech
SpeechToElement.toggle('webspeech', {
element: textEl,
onStart: () => {
buttonEl.innerText = 'Stop';
},
onStop: () => {
buttonEl.innerText = 'Start';
},
onError: () => {
errorEl.style.display = 'block';
buttonEl.innerText = 'Start';
},
});
// Azure
// set your REGION and SUBSCRIPTION-KEY
// SpeechToElement.toggle('azure', {
// region: 'eastus',
// subscriptionKey: '2473441130e84b6c84457e697ce0a108',
// element: textEl,
// onStart: () => {
// buttonEl.innerText = 'Stop';
// },
// onStop: () => {
// buttonEl.innerText = 'Start';
// },
// onError: () => {
// errorEl.style.display = 'block';
// buttonEl.innerText = 'Start';
// },
// });
};
</script>
</body>
Expand Down
37 changes: 37 additions & 0 deletions component/indexStyle.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
body {
font-family: sans-serif;
text-align: center;
}

#title {
margin-top: 40px;
}

#text {
text-align: left;
width: 50%;
height: 200px;
border: 1px solid grey;
margin-top: 50px;
margin-left: auto;
margin-right: auto;
border-radius: 5px;
padding: 3px;
}

#button {
display: block;
margin-top: 25px;
margin-left: auto;
margin-right: auto;
width: 80px;
height: 30px;
font-size: 18px;
}

#error {
display: none;
margin-top: 20px;
font-size: 18px;
color: red;
}
4 changes: 2 additions & 2 deletions component/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion component/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "speech-to-element",
"version": "0.1.66",
"version": "1.0.0",
"description": "Transcribe your speech into text, embed it into elements and more",
"main": "dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions website/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions website/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "speech-to-element-website",
"version": "0.1.0",
"version": "1.0.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.16.5",
Expand All @@ -10,7 +10,7 @@
"@types/node": "^16.18.38",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"speech-to-element": "latest",
"speech-to-element": "1.0.0",
"microsoft-cognitiveservices-speech-sdk": "^1.30.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down

0 comments on commit 5ced207

Please sign in to comment.