forked from React-Group/interstellar_ai
voice recognition trial 2
This commit is contained in:
parent
eded5f81d9
commit
e23da7a579
4 changed files with 24 additions and 2 deletions
|
@ -4,7 +4,7 @@ class VoiceSend {
|
||||||
sendToVoiceRecognition(audio_data: Blob) {
|
sendToVoiceRecognition(audio_data: Blob) {
|
||||||
console.log("sending recording...");
|
console.log("sending recording...");
|
||||||
|
|
||||||
const dataSend = { audio_data }
|
const dataSend = { audio:audio_data, option:"offline", recognition_type: "basic" }
|
||||||
axios.post("http://localhost:5000/interstellar_ai/api/voice_recognition", dataSend)
|
axios.post("http://localhost:5000/interstellar_ai/api/voice_recognition", dataSend)
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
console.log(response['response'])
|
console.log(response['response'])
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { useState, ForwardedRef, useEffect } from 'react';
|
import React, { useState, ForwardedRef, useEffect } from 'react';
|
||||||
|
import "../styles/variables.css"
|
||||||
|
|
||||||
interface InputProps {
|
interface InputProps {
|
||||||
message: string;
|
message: string;
|
||||||
|
@ -30,6 +31,10 @@ const InputFrontend = React.forwardRef<HTMLDivElement, InputProps>(
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const styles = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="input" id="inputForm" ref={ref}>
|
<div className="input" id="inputForm" ref={ref}>
|
||||||
<input
|
<input
|
||||||
|
@ -43,7 +48,7 @@ const InputFrontend = React.forwardRef<HTMLDivElement, InputProps>(
|
||||||
<button type="button" onClick={() => onSendClick(inputValue, false)} disabled={inputDisabled ? true : false}>
|
<button type="button" onClick={() => onSendClick(inputValue, false)} disabled={inputDisabled ? true : false}>
|
||||||
<img src="/img/send.svg" alt="send" />
|
<img src="/img/send.svg" alt="send" />
|
||||||
</button>
|
</button>
|
||||||
<button type="button" onClick={onMicClick} style={{backgroundColor: isRecording? "red" : "green"}}>
|
<button className={`microphone-button ${isRecording ? "red":"green"}`} type="button" onClick={onMicClick}>
|
||||||
<img src="/img/microphone.svg" alt="microphone" />
|
<img src="/img/microphone.svg" alt="microphone" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -59,3 +59,19 @@
|
||||||
background-color: var(--input-button-hover-color);
|
background-color: var(--input-button-hover-color);
|
||||||
box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
|
box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.microphone-button.red{
|
||||||
|
background-color: var(--close-button-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.microphone-button.green{
|
||||||
|
background-color: var(--button-background-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.microphone-button.red:hover{
|
||||||
|
background-color: var(--close-button-hover-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.microphone-button.green:hover{
|
||||||
|
background-color: var(--input-button-hover-color);
|
||||||
|
}
|
|
@ -19,6 +19,7 @@
|
||||||
--conversation-background-color: #79832e; /* Background color for conversation container */
|
--conversation-background-color: #79832e; /* Background color for conversation container */
|
||||||
--doc-background-color: #ffffff; /* Background color for documents */
|
--doc-background-color: #ffffff; /* Background color for documents */
|
||||||
--close-button-color: red;
|
--close-button-color: red;
|
||||||
|
--close-button-hover-color: #9e0101; /*NEW*/
|
||||||
--burger-menu-background-color: #79832e; /*NEW*/
|
--burger-menu-background-color: #79832e; /*NEW*/
|
||||||
--overlay-text-color:white; /*NEW*/
|
--overlay-text-color:white; /*NEW*/
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue