bluejoyq

drop voice recognition

{
"devToolsPort": 19002,
"expoServerPort": 19000,
"packagerPort": null,
"packagerPid": null,
"packagerPort": 19001,
"packagerPid": 4420,
"expoServerNgrokUrl": "https://ep-ukj.anonymous.searchguide.exp.direct",
"packagerNgrokUrl": "https://packager.ep-ukj.anonymous.searchguide.exp.direct",
"ngrokPid": 28468
"ngrokPid": 26692
}
......
......@@ -17,8 +17,8 @@ class Rate extends React.Component {
render() {
return(
<View>
<Text>평가</Text>
<View >
<Text >평가</Text>
</View>
)
}
......
import React from 'react';
import {View} from 'react-native';
import {View,ScrollView} from 'react-native';
import { Searchbar } from 'react-native-paper';
import Icon from 'react-native-vector-icons/FontAwesome';
......@@ -10,16 +10,15 @@ export default class SearchBar extends React.Component {
render(){
return(
<View style={{flexDirection: 'row'}}>
<Searchbar style={{flex: 0.9}}
<>
<View style={{margin:0,padding:0}}>
<Searchbar
placeholder="검색할 질문을 입력하세요."
onChangeText={query => { this.setState({ firstQuery: query }); }}
value={this.state.firstQuery}
/>
<View style={{flex:0.15,flexDirection: 'column', justifycontent:'center', alignItems:'center' }} >
<Icon name="bar-chart-o" size={30} />
</View>
</View>
</>
)
}
}
\ No newline at end of file
......
import React, { Component } from 'react';
import { StyleSheet, Text, View, Image, TouchableHighlight } from 'react-native';
import Voice from 'react-native-voice';
import * as Permissions from "expo-permissions";
/*
순수 react native 프로젝트로 변경후 업뎃 필요!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
class VoiceTest extends Component {
constructor(props) {
super(props)
Voice.onSpeechStart = this.onSpeechStartHandler;
Voice.onSpeechEnd = this.onSpeechEndHandler;
Voice.onSpeechResults = this.onSpeechResultsHandler;
this.state = {
showRecordButton: false,
result: []
}
}
async componentDidMount() {
const { status, expires, permissions } = await Permissions.askAsync(
Permissions.AUDIO_RECORDING
);
if (status !== "granted") {
//Permissions not granted. Don't show the start recording button because it will cause problems if it's pressed.
this.setState({showRecordButton: false});
} else {
this.setState({showRecordButton: true});
}
}
componentWillUnmount() {
Voice.destroy().then(Voice.removeAllListeners);
}
onSpeechStartHandler = e => {
console.log('onSpeechStart: ', e);
};
onSpeechEndHandler = e => {
console.log('onSpeechEnd: ', e);
};
onSpeechResultsHandler = e => {
console.log('onSpeechResults: ', e);
this.setState({
results: e.value,
});
}
_startRecognizing = async () => {
try {
await Voice.start('ko-KR', {
"RECOGNIZER_ENGINE": "GOOGLE",
"EXTRA_PARTIAL_RESULTS": true
});
} catch (e) {
//eslint-disable-next-line
console.error(e);
}
};
_stopRecognizing = async () => {
try {
await Voice.stop();
} catch (e) {
//eslint-disable-next-line
console.error(e);
}
};
_cancelRecognizing = async () => {
try {
await Voice.cancel();
} catch (e) {
//eslint-disable-next-line
console.error(e);
}
};
_destroyRecognizer = async () => {
try {
await Voice.destroy();
} catch (e) {
//eslint-disable-next-line
console.error(e);
}
};
render(){
return(
<View>
<TouchableHighlight onPress={this._startRecognizing}>
<Text>Start Recognizing</Text>
</TouchableHighlight>
<TouchableHighlight onPress={this._stopRecognizing}>
<Text>Stop Recognizing</Text>
</TouchableHighlight>
<TouchableHighlight onPress={this._cancelRecognizing}>
<Text>Cancel</Text>
</TouchableHighlight>
<TouchableHighlight onPress={this._destroyRecognizer}>
<Text>Destroy</Text>
</TouchableHighlight>
</View>
)
}
}
export default VoiceTest;
\ No newline at end of file
......@@ -2594,6 +2594,11 @@
"resolved": "https://registry.npmjs.org/expo-permissions/-/expo-permissions-7.0.0.tgz",
"integrity": "sha512-C+qyVz+pdZO4YpVR2HSC3gsBZg0Qb8brCFgzmDmWcAtgrOiHClaLPdhI2XtQuGh8ubXcKPUGZp++UCEGiG0Jxg=="
},
"expo-speech": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/expo-speech/-/expo-speech-7.0.0.tgz",
"integrity": "sha512-746OmuP0os0z8750s0hwALIVQS7wGDFMwC4+C1eFLEZrN65i2695CTh6MyRTaOwTN87AVVak6j585sQ680MqyQ=="
},
"expo-sqlite": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/expo-sqlite/-/expo-sqlite-7.0.0.tgz",
......
......@@ -10,6 +10,8 @@
"dependencies": {
"1.3.0": "^1.3.0",
"expo": "^35.0.0",
"expo-permissions": "~7.0.0",
"expo-speech": "~7.0.0",
"react": "16.8.3",
"react-dom": "16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
......