{"id":85750,"date":"2024-11-27T21:09:45","date_gmt":"2024-11-27T17:39:45","guid":{"rendered":"https:\/\/nabfollower.com\/blog\/how-to-implement-voice-to-text-in-react-native-3j0d\/"},"modified":"2024-11-27T21:09:45","modified_gmt":"2024-11-27T17:39:45","slug":"how-to-implement-voice-to-text-in-react-native-3j0d","status":"publish","type":"post","link":"https:\/\/nabfollower.com\/blog\/how-to-implement-voice-to-text-in-react-native-3j0d\/","title":{"rendered":"\u0646\u062d\u0648\u0647 \u067e\u06cc\u0627\u062f\u0647 \u0633\u0627\u0632\u06cc \u0635\u062f\u0627 \u0628\u0647 \u0645\u062a\u0646 \u062f\u0631 React Native"},"content":{"rendered":"<p>Summarize this content to 400 words in Persian Lang <\/p>\n<p>  \u0645\u0642\u062f\u0645\u0647<\/p>\n<p>\u062f\u0631 \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647\u060c \u0634\u0645\u0627 \u0631\u0627 \u0628\u0627 \u0627\u062f\u063a\u0627\u0645 \u0622\u0646 \u0622\u0634\u0646\u0627 \u062e\u0648\u0627\u0647\u06cc\u0645 \u06a9\u0631\u062f @react-native-voice\/voice \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0631\u0627 \u062f\u0631 \u067e\u0631\u0648\u0698\u0647 React Native \u0645\u0627 \u0641\u0639\u0627\u0644 \u06a9\u0646\u06cc\u062f voice-to-text \u0639\u0645\u0644\u06a9\u0631\u062f \u0627\u06cc\u0646 \u0648\u06cc\u0698\u06af\u06cc \u0631\u0627 \u0645\u06cc \u062a\u0648\u0627\u0646 \u062f\u0631 \u0633\u0646\u0627\u0631\u06cc\u0648\u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641\u06cc \u0645\u0627\u0646\u0646\u062f \u0628\u0631\u0646\u0627\u0645\u0647 \u0647\u0627\u06cc \u062f\u06cc\u06a9\u062a\u0647\u060c \u0641\u0631\u0645\u0627\u0646 \u0647\u0627\u06cc \u0635\u0648\u062a\u06cc \u06cc\u0627 \u0648\u06cc\u0698\u06af\u06cc \u0647\u0627\u06cc \u062c\u0633\u062a\u062c\u0648 \u0628\u0647 \u0635\u0648\u0631\u062a \u0635\u0648\u062a\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f.<\/p>\n<p>  1. \u0646\u0635\u0628 \u0648 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc<\/p>\n<p>\u0627\u0628\u062a\u062f\u0627 \u0628\u0627\u06cc\u062f \u0622\u0646 \u0631\u0627 \u0646\u0635\u0628 \u06a9\u0646\u06cc\u062f @react-native-voice\/voice \u0628\u0633\u062a\u0647 \u0628\u0646\u062f\u06cc \u0634\u0645\u0627 \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0631\u0627 \u0628\u0627 \u0627\u062c\u0631\u0627 \u0627\u0646\u062c\u0627\u0645 \u062f\u0647\u06cc\u062f:<\/p>\n<p>npm install @react-native-voice\/voice<\/p>\n<p>    \u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/p>\n<p>    \u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/p>\n<p>  2. \u067e\u06cc\u06a9\u0631\u0628\u0646\u062f\u06cc \u0627\u0646\u062f\u0631\u0648\u06cc\u062f<\/p>\n<p>\u0628\u0631\u0627\u06cc \u0627\u0646\u062f\u0631\u0648\u06cc\u062f\u060c \u0628\u0627\u06cc\u062f \u0645\u062c\u0648\u0632 \u0645\u06cc\u06a9\u0631\u0648\u0641\u0648\u0646 \u0631\u0627 \u062f\u0631 \u0642\u0633\u0645\u062a \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u06a9\u0646\u06cc\u062f AndroidManifest.xml \u0641\u0627\u06cc\u0644 \u062e\u0637 \u0632\u06cc\u0631 \u0631\u0627 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f:<\/p>\n<p>    \u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/p>\n<p>    \u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/p>\n<p>  3. \u067e\u06cc\u06a9\u0631\u0628\u0646\u062f\u06cc iOS<\/p>\n<p>\u0628\u0631\u0627\u06cc iOS\u060c \u0628\u0627\u06cc\u062f \u0645\u062c\u0648\u0632\u0647\u0627\u06cc \u0645\u06cc\u06a9\u0631\u0648\u0641\u0648\u0646 \u0648 \u062a\u0634\u062e\u06cc\u0635 \u06af\u0641\u062a\u0627\u0631 \u0631\u0627 \u062f\u0631 \u062e\u0648\u062f \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f Info.plist \u0641\u0627\u06cc\u0644:<\/p>\n<p>NSMicrophoneUsageDescription<br \/>\nDescription of why you require the use of the microphone<br \/>\nNSSpeechRecognitionUsageDescription<br \/>\nDescription of why you require the use of the speech recognition<\/p>\n<p>    \u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/p>\n<p>    \u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/p>\n<p>\u0645\u0637\u0645\u0626\u0646 \u0634\u0648\u06cc\u062f \u06a9\u0647 \u062a\u0648\u0636\u06cc\u062d\u0627\u062a \u062f\u0642\u06cc\u0642\u0627 \u062a\u0648\u0636\u06cc\u062d \u0645\u06cc\u200c\u062f\u0647\u0646\u062f \u06a9\u0647 \u0686\u0631\u0627 \u0628\u0631\u0646\u0627\u0645\u0647 \u0634\u0645\u0627 \u0628\u0647 \u0627\u06cc\u0646 \u0645\u062c\u0648\u0632\u0647\u0627 \u0646\u06cc\u0627\u0632 \u062f\u0627\u0631\u062f.<\/p>\n<p>  4. \u0645\u062f\u06cc\u0631\u06cc\u062a \u062a\u0634\u062e\u06cc\u0635 \u0635\u062f\u0627<\/p>\n<p>\u062f\u0631 \u0627\u06cc\u0646\u062c\u0627 \u0646\u062d\u0648\u0647 \u062a\u0646\u0638\u06cc\u0645 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u062f\u0631 \u0645\u0624\u0644\u0641\u0647 React Native \u0622\u0645\u062f\u0647 \u0627\u0633\u062a.<\/p>\n<p>\u0627\u0644\u0641 \u0648\u0627\u0631\u062f \u06a9\u0631\u062f\u0646 \u0635\u062f\u0627<\/p>\n<p>import Voice, {<br \/>\n  SpeechRecognizedEvent,<br \/>\n  SpeechResultsEvent,<br \/>\n  SpeechErrorEvent,<br \/>\n} from &#8220;@react-native-voice\/voice&#8221;;<\/p>\n<p>    \u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/p>\n<p>    \u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/p>\n<p>\u0628 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u062d\u0627\u0644\u062a<\/p>\n<p>const [recognized, setRecognized] = useState(&#8220;&#8221;);<br \/>\nconst [pitch, setPitch] = useState(&#8220;&#8221;);<br \/>\nconst [error, setError] = useState(&#8220;&#8221;);<br \/>\nconst [end, setEnd] = useState(&#8220;&#8221;);<br \/>\nconst [started, setStarted] = useState(&#8220;&#8221;);<br \/>\nconst [results, setResults] = useState([]);<br \/>\nconst [partialResults, setPartialResults] = useState([]);<\/p>\n<p>    \u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/p>\n<p>    \u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/p>\n<p>\u062c. \u0631\u0627\u0647\u200c\u0627\u0646\u062f\u0627\u0632\u06cc \u06a9\u0646\u062a\u0631\u0644\u200c\u06a9\u0646\u0646\u062f\u0647\u200c\u0647\u0627\u06cc \u0631\u0648\u06cc\u062f\u0627\u062f \u0635\u0648\u062a\u06cc<\/p>\n<p>\u062f\u0627\u062e\u0644 useEffect \u0647\u0648\u06a9\u060c \u06a9\u0646\u062a\u0631\u0644 \u06a9\u0646\u0646\u062f\u0647 \u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641 \u0631\u0648\u06cc\u062f\u0627\u062f \u0631\u0627 \u0645\u0642\u062f\u0627\u0631\u062f\u0647\u06cc \u0627\u0648\u0644\u06cc\u0647 \u06a9\u0646\u06cc\u062f:<\/p>\n<p>useEffect(() =&gt; {<br \/>\n  Voice.onSpeechStart = (e) =&gt; {<br \/>\n    console.log(&#8220;onSpeechStart: &#8220;, e);<br \/>\n    setStarted(&#8220;\u221a&#8221;);<br \/>\n  };<\/p>\n<p>  Voice.onSpeechRecognized = (e) =&gt; {<br \/>\n    console.log(&#8220;onSpeechRecognized: &#8220;, e);<br \/>\n    setRecognized(&#8220;\u221a&#8221;);<br \/>\n  };<\/p>\n<p>  Voice.onSpeechEnd = (e) =&gt; {<br \/>\n    console.log(&#8220;onSpeechEnd: &#8220;, e);<br \/>\n    setEnd(&#8220;\u221a&#8221;);<br \/>\n  };<\/p>\n<p>  Voice.onSpeechError = (e) =&gt; {<br \/>\n    console.log(&#8220;onSpeechError: &#8220;, e);<br \/>\n    setError(JSON.stringify(e.error));<br \/>\n  };<\/p>\n<p>  Voice.onSpeechResults = (e) =&gt; {<br \/>\n    console.log(&#8220;onSpeechResults: &#8220;, e);<br \/>\n    setResults(e.value);<br \/>\n  };<\/p>\n<p>  Voice.onSpeechPartialResults = (e) =&gt; {<br \/>\n    console.log(&#8220;onSpeechPartialResults: &#8220;, e);<br \/>\n    setPartialResults(e.value);<br \/>\n  };<\/p>\n<p>  Voice.onSpeechVolumeChanged = (e) =&gt; {<br \/>\n    console.log(&#8220;onSpeechVolumeChanged: &#8220;, e);<br \/>\n    setPitch(e.value);<br \/>\n  };<\/p>\n<p>  return () =&gt; {<br \/>\n    Voice.destroy().then(Voice.removeAllListeners);<br \/>\n  };<br \/>\n}, []);<\/p>\n<p>    \u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/p>\n<p>    \u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/p>\n<p>\u062f \u0634\u0631\u0648\u0639 \u0648 \u062a\u0648\u0642\u0641 \u062a\u0634\u062e\u06cc\u0635<\/p>\n<p>\u0628\u0631\u0627\u06cc \u0634\u0631\u0648\u0639\u060c \u062a\u0648\u0642\u0641\u060c \u0644\u063a\u0648 \u06cc\u0627 \u0627\u0632 \u0628\u06cc\u0646 \u0628\u0631\u062f\u0646 \u0634\u0646\u0627\u0633\u0627\u06cc\u06cc\u060c \u062a\u0648\u0627\u0628\u0639 \u0632\u06cc\u0631 \u0631\u0627 \u062a\u0639\u0631\u06cc\u0641 \u06a9\u0646\u06cc\u062f:<\/p>\n<p>const startRecognizing = async () =&gt; {<br \/>\n  try {<br \/>\n    await Voice.start(&#8220;en-US&#8221;);<br \/>\n  } catch (e) {<br \/>\n    console.error(e);<br \/>\n  }<br \/>\n};<\/p>\n<p>const stopRecognizing = async () =&gt; {<br \/>\n  try {<br \/>\n    await Voice.stop();<br \/>\n  } catch (e) {<br \/>\n    console.error(e);<br \/>\n  }<br \/>\n};<\/p>\n<p>const cancelRecognizing = async () =&gt; {<br \/>\n  try {<br \/>\n    await Voice.cancel();<br \/>\n  } catch (e) {<br \/>\n    console.error(e);<br \/>\n  }<br \/>\n};<\/p>\n<p>const destroyRecognizer = async () =&gt; {<br \/>\n  try {<br \/>\n    await Voice.destroy();<br \/>\n  } catch (e) {<br \/>\n    console.error(e);<br \/>\n  }<br \/>\n  resetStates();<br \/>\n};<\/p>\n<p>const resetStates = () =&gt; {<br \/>\n  setRecognized(&#8220;&#8221;);<br \/>\n  setPitch(&#8220;&#8221;);<br \/>\n  setError(&#8220;&#8221;);<br \/>\n  setStarted(&#8220;&#8221;);<br \/>\n  setResults([]);<br \/>\n  setPartialResults([]);<br \/>\n  setEnd(&#8220;&#8221;);<br \/>\n};<\/p>\n<p>    \u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/p>\n<p>    \u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/p>\n<p>  5. \u067e\u06cc\u0627\u062f\u0647 \u0633\u0627\u0632\u06cc UI<\/p>\n<p>\u0627\u06a9\u0646\u0648\u0646\u060c \u06cc\u06a9 \u0631\u0627\u0628\u0637 \u06a9\u0627\u0631\u0628\u0631\u06cc \u0633\u0627\u062f\u0647 \u0628\u0631\u0627\u06cc \u062a\u0639\u0627\u0645\u0644 \u0628\u0627 \u0633\u06cc\u0633\u062a\u0645 \u062a\u0634\u062e\u06cc\u0635 \u0635\u062f\u0627 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f:<\/p>\n<p>  Welcome to React Native Voice!<br \/>\n  Press the button and start speaking.<br \/>\n  {`Started: ${started}`}<br \/>\n  {`Recognized: ${recognized}`}<br \/>\n  {`Pitch: ${pitch}`}<br \/>\n  {`Error: ${error}`}<br \/>\n  Results<br \/>\n  {results.map((result, index) =&gt; (<br \/>\n    {result}<br \/>\n  ))}<br \/>\n  Partial Results<br \/>\n  {partialResults.map((result, index) =&gt; (<br \/>\n    {result}<br \/>\n  ))}<br \/>\n  {`End: ${end}`}<\/p>\n<p>    Start<\/p>\n<p>    Stop Recognizing<\/p>\n<p>    Cancel<\/p>\n<p>    Destroy<\/p>\n<p>    \u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/p>\n<p>    \u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/p>\n<p>  6. \u06cc\u06a9 \u0638\u0627\u0647\u0631 \u0637\u0631\u0627\u062d\u06cc \u0634\u062f\u0647<\/p>\n<p>const styles = StyleSheet.create({<br \/>\n  container: {<br \/>\n    flex: 1,<br \/>\n    justifyContent: &#8220;center&#8221;,<br \/>\n    alignItems: &#8220;center&#8221;,<br \/>\n    backgroundColor: &#8220;#F5FCFF&#8221;,<br \/>\n    marginTop: 33,<br \/>\n  },<br \/>\n  welcome: {<br \/>\n    fontSize: 20,<br \/>\n    textAlign: &#8220;center&#8221;,<br \/>\n    margin: 10,<br \/>\n  },<br \/>\n  action: {<br \/>\n    textAlign: &#8220;center&#8221;,<br \/>\n    color: &#8220;#0000FF&#8221;,<br \/>\n    marginVertical: 5,<br \/>\n    fontWeight: &#8220;bold&#8221;,<br \/>\n  },<br \/>\n  instructions: {<br \/>\n    textAlign: &#8220;center&#8221;,<br \/>\n    color: &#8220;#333333&#8221;,<br \/>\n    marginBottom: 5,<br \/>\n  },<br \/>\n  stat: {<br \/>\n    textAlign: &#8220;center&#8221;,<br \/>\n    color: &#8220;#B0171F&#8221;,<br \/>\n    marginBottom: 1,<br \/>\n  },<br \/>\n});<\/p>\n<p>    \u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/p>\n<p>    \u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/p>\n<p>  7. \u06cc\u0627\u062f\u062f\u0627\u0634\u062a \u0647\u0627<\/p>\n<p>\u062a\u0634\u062e\u06cc\u0635 \u0635\u062f\u0627 \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u062f\u0631 \u0634\u0628\u06cc\u0647 \u0633\u0627\u0632\u0647\u0627\u06cc \u0627\u0646\u062f\u0631\u0648\u06cc\u062f \u06a9\u0627\u0631 \u0646\u06a9\u0646\u062f. \u062a\u0633\u062a \u0628\u0631 \u0631\u0648\u06cc \u06cc\u06a9 \u062f\u0633\u062a\u06af\u0627\u0647 \u0648\u0627\u0642\u0639\u06cc \u062a\u0648\u0635\u06cc\u0647 \u0645\u06cc \u0634\u0648\u062f.<br \/>\n\u062f\u0631 iOS\u060c \u0627\u06af\u0631 \u0645\u062c\u0648\u0632\u0647\u0627\u06cc \u0644\u0627\u0632\u0645 \u0628\u0647 \u062f\u0631\u0633\u062a\u06cc \u0628\u0647 \u0622\u0646 \u0627\u0636\u0627\u0641\u0647 \u0646\u0634\u0648\u062f\u060c \u062e\u0631\u0627\u0628\u06cc \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0631\u062e \u062f\u0647\u062f Info.plist.<\/p>\n<p>  \u0646\u062a\u06cc\u062c\u0647 \u06af\u06cc\u0631\u06cc<\/p>\n<p>\u0628\u0627 \u062f\u0646\u0628\u0627\u0644 \u06a9\u0631\u062f\u0646 \u0645\u0631\u0627\u062d\u0644 \u0627\u06cc\u0646 \u0631\u0627\u0647\u0646\u0645\u0627\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 @react-native-voice\/voice\u060c \u0639\u0645\u0644\u06a9\u0631\u062f \u0635\u062f\u0627 \u0628\u0647 \u0645\u062a\u0646 \u0631\u0627 \u0628\u0647 \u0633\u0631\u0639\u062a \u062f\u0631 \u0628\u0631\u0646\u0627\u0645\u0647 React Native \u062e\u0648\u062f \u0627\u062f\u063a\u0627\u0645 \u06a9\u0646\u06cc\u062f. \u0686\u0647 \u062f\u0631 \u062d\u0627\u0644 \u062a\u0648\u0633\u0639\u0647 \u0631\u0627\u0628\u0637 \u0647\u0627\u06cc \u0647\u0646\u062f\u0632\u0641\u0631\u06cc \u0628\u0627\u0634\u06cc\u062f \u0648 \u0686\u0647 \u0628\u0647 \u0633\u0627\u062f\u06af\u06cc \u062a\u0639\u0627\u0645\u0644 \u06a9\u0627\u0631\u0628\u0631 \u0631\u0627 \u0627\u0641\u0632\u0627\u06cc\u0634 \u062f\u0647\u06cc\u062f\u060c \u0627\u06cc\u0646 \u0627\u0628\u0632\u0627\u0631 \u0645\u06cc \u062a\u0648\u0627\u0646\u062f \u0627\u0641\u0632\u0648\u062f\u0646\u06cc \u0642\u062f\u0631\u062a\u0645\u0646\u062f \u0628\u0631\u0627\u06cc \u0628\u0631\u0646\u0627\u0645\u0647 \u0634\u0645\u0627 \u0628\u0627\u0634\u062f.<\/p>\n<div data-article-id=\"1994999\" id=\"article-body\">\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter-rtl ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u0641\u0647\u0631\u0633\u062a \u0645\u0637\u0627\u0644\u0628<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/nabfollower.com\/blog\/how-to-implement-voice-to-text-in-react-native-3j0d\/#%D9%85%D9%82%D8%AF%D9%85%D9%87\" >\u0645\u0642\u062f\u0645\u0647<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/nabfollower.com\/blog\/how-to-implement-voice-to-text-in-react-native-3j0d\/#1_%D9%86%D8%B5%D8%A8_%D9%88_%D8%B1%D8%A7%D9%87_%D8%A7%D9%86%D8%AF%D8%A7%D8%B2%DB%8C\" >1. \u0646\u0635\u0628 \u0648 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/nabfollower.com\/blog\/how-to-implement-voice-to-text-in-react-native-3j0d\/#2_%D9%BE%DB%8C%DA%A9%D8%B1%D8%A8%D9%86%D8%AF%DB%8C_%D8%A7%D9%86%D8%AF%D8%B1%D9%88%DB%8C%D8%AF\" >2. \u067e\u06cc\u06a9\u0631\u0628\u0646\u062f\u06cc \u0627\u0646\u062f\u0631\u0648\u06cc\u062f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/nabfollower.com\/blog\/how-to-implement-voice-to-text-in-react-native-3j0d\/#3_%D9%BE%DB%8C%DA%A9%D8%B1%D8%A8%D9%86%D8%AF%DB%8C_iOS\" >3. \u067e\u06cc\u06a9\u0631\u0628\u0646\u062f\u06cc iOS<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/nabfollower.com\/blog\/how-to-implement-voice-to-text-in-react-native-3j0d\/#4_%D9%85%D8%AF%DB%8C%D8%B1%DB%8C%D8%AA_%D8%AA%D8%B4%D8%AE%DB%8C%D8%B5_%D8%B5%D8%AF%D8%A7\" >4. \u0645\u062f\u06cc\u0631\u06cc\u062a \u062a\u0634\u062e\u06cc\u0635 \u0635\u062f\u0627<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/nabfollower.com\/blog\/how-to-implement-voice-to-text-in-react-native-3j0d\/#5_%D9%BE%DB%8C%D8%A7%D8%AF%D9%87_%D8%B3%D8%A7%D8%B2%DB%8C_UI\" >5. \u067e\u06cc\u0627\u062f\u0647 \u0633\u0627\u0632\u06cc UI<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/nabfollower.com\/blog\/how-to-implement-voice-to-text-in-react-native-3j0d\/#6_%DB%8C%DA%A9_%D8%B8%D8%A7%D9%87%D8%B1_%D8%B7%D8%B1%D8%A7%D8%AD%DB%8C_%D8%B4%D8%AF%D9%87\" >6. \u06cc\u06a9 \u0638\u0627\u0647\u0631 \u0637\u0631\u0627\u062d\u06cc \u0634\u062f\u0647<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/nabfollower.com\/blog\/how-to-implement-voice-to-text-in-react-native-3j0d\/#7_%DB%8C%D8%A7%D8%AF%D8%AF%D8%A7%D8%B4%D8%AA_%D9%87%D8%A7\" >7. \u06cc\u0627\u062f\u062f\u0627\u0634\u062a \u0647\u0627<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/nabfollower.com\/blog\/how-to-implement-voice-to-text-in-react-native-3j0d\/#%D9%86%D8%AA%DB%8C%D8%AC%D9%87_%DA%AF%DB%8C%D8%B1%DB%8C\" >\u0646\u062a\u06cc\u062c\u0647 \u06af\u06cc\u0631\u06cc<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"%D9%85%D9%82%D8%AF%D9%85%D9%87\"><\/span>\n<p>  \u0645\u0642\u062f\u0645\u0647<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u062f\u0631 \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647\u060c \u0634\u0645\u0627 \u0631\u0627 \u0628\u0627 \u0627\u062f\u063a\u0627\u0645 \u0622\u0646 \u0622\u0634\u0646\u0627 \u062e\u0648\u0627\u0647\u06cc\u0645 \u06a9\u0631\u062f <code>@react-native-voice\/voice<\/code> \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0631\u0627 \u062f\u0631 \u067e\u0631\u0648\u0698\u0647 React Native \u0645\u0627 \u0641\u0639\u0627\u0644 \u06a9\u0646\u06cc\u062f <code>voice-to-text<\/code> \u0639\u0645\u0644\u06a9\u0631\u062f \u0627\u06cc\u0646 \u0648\u06cc\u0698\u06af\u06cc \u0631\u0627 \u0645\u06cc \u062a\u0648\u0627\u0646 \u062f\u0631 \u0633\u0646\u0627\u0631\u06cc\u0648\u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641\u06cc \u0645\u0627\u0646\u0646\u062f \u0628\u0631\u0646\u0627\u0645\u0647 \u0647\u0627\u06cc \u062f\u06cc\u06a9\u062a\u0647\u060c \u0641\u0631\u0645\u0627\u0646 \u0647\u0627\u06cc \u0635\u0648\u062a\u06cc \u06cc\u0627 \u0648\u06cc\u0698\u06af\u06cc \u0647\u0627\u06cc \u062c\u0633\u062a\u062c\u0648 \u0628\u0647 \u0635\u0648\u0631\u062a \u0635\u0648\u062a\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"1_%D9%86%D8%B5%D8%A8_%D9%88_%D8%B1%D8%A7%D9%87_%D8%A7%D9%86%D8%AF%D8%A7%D8%B2%DB%8C\"><\/span>\n<p>  1. \u0646\u0635\u0628 \u0648 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u0627\u0628\u062a\u062f\u0627 \u0628\u0627\u06cc\u062f \u0622\u0646 \u0631\u0627 \u0646\u0635\u0628 \u06a9\u0646\u06cc\u062f <code>@react-native-voice\/voice<\/code> \u0628\u0633\u062a\u0647 \u0628\u0646\u062f\u06cc \u0634\u0645\u0627 \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0631\u0627 \u0628\u0627 \u0627\u062c\u0631\u0627 \u0627\u0646\u062c\u0627\u0645 \u062f\u0647\u06cc\u062f:<\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>npm install @react-native-voice\/voice\n<\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"2_%D9%BE%DB%8C%DA%A9%D8%B1%D8%A8%D9%86%D8%AF%DB%8C_%D8%A7%D9%86%D8%AF%D8%B1%D9%88%DB%8C%D8%AF\"><\/span>\n<p>  2. \u067e\u06cc\u06a9\u0631\u0628\u0646\u062f\u06cc \u0627\u0646\u062f\u0631\u0648\u06cc\u062f<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u0628\u0631\u0627\u06cc \u0627\u0646\u062f\u0631\u0648\u06cc\u062f\u060c \u0628\u0627\u06cc\u062f \u0645\u062c\u0648\u0632 \u0645\u06cc\u06a9\u0631\u0648\u0641\u0648\u0646 \u0631\u0627 \u062f\u0631 \u0642\u0633\u0645\u062a \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u06a9\u0646\u06cc\u062f <code>AndroidManifest.xml<\/code> \u0641\u0627\u06cc\u0644 \u062e\u0637 \u0632\u06cc\u0631 \u0631\u0627 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f:<\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code><uses-permission android:name=\"android.permission.RECORD_AUDIO\"\/>\n\n<\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"3_%D9%BE%DB%8C%DA%A9%D8%B1%D8%A8%D9%86%D8%AF%DB%8C_iOS\"><\/span>\n<p>  3. \u067e\u06cc\u06a9\u0631\u0628\u0646\u062f\u06cc iOS<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u0628\u0631\u0627\u06cc iOS\u060c \u0628\u0627\u06cc\u062f \u0645\u062c\u0648\u0632\u0647\u0627\u06cc \u0645\u06cc\u06a9\u0631\u0648\u0641\u0648\u0646 \u0648 \u062a\u0634\u062e\u06cc\u0635 \u06af\u0641\u062a\u0627\u0631 \u0631\u0627 \u062f\u0631 \u062e\u0648\u062f \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f <code>Info.plist<\/code> \u0641\u0627\u06cc\u0644:<\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code><key>NSMicrophoneUsageDescription<\/key>\n<string>Description of why you require the use of the microphone<\/string>\n<key>NSSpeechRecognitionUsageDescription<\/key>\n<string>Description of why you require the use of the speech recognition<\/string>\n\n<\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>\u0645\u0637\u0645\u0626\u0646 \u0634\u0648\u06cc\u062f \u06a9\u0647 \u062a\u0648\u0636\u06cc\u062d\u0627\u062a \u062f\u0642\u06cc\u0642\u0627 \u062a\u0648\u0636\u06cc\u062d \u0645\u06cc\u200c\u062f\u0647\u0646\u062f \u06a9\u0647 \u0686\u0631\u0627 \u0628\u0631\u0646\u0627\u0645\u0647 \u0634\u0645\u0627 \u0628\u0647 \u0627\u06cc\u0646 \u0645\u062c\u0648\u0632\u0647\u0627 \u0646\u06cc\u0627\u0632 \u062f\u0627\u0631\u062f.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"4_%D9%85%D8%AF%DB%8C%D8%B1%DB%8C%D8%AA_%D8%AA%D8%B4%D8%AE%DB%8C%D8%B5_%D8%B5%D8%AF%D8%A7\"><\/span>\n<p>  4. \u0645\u062f\u06cc\u0631\u06cc\u062a \u062a\u0634\u062e\u06cc\u0635 \u0635\u062f\u0627<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u062f\u0631 \u0627\u06cc\u0646\u062c\u0627 \u0646\u062d\u0648\u0647 \u062a\u0646\u0638\u06cc\u0645 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u062f\u0631 \u0645\u0624\u0644\u0641\u0647 React Native \u0622\u0645\u062f\u0647 \u0627\u0633\u062a.<\/p>\n<p><strong>\u0627\u0644\u0641 \u0648\u0627\u0631\u062f \u06a9\u0631\u062f\u0646 \u0635\u062f\u0627<\/strong><\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>import Voice, {\n  SpeechRecognizedEvent,\n  SpeechResultsEvent,\n  SpeechErrorEvent,\n} from \"@react-native-voice\/voice\";\n\n<\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>\u0628 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u062d\u0627\u0644\u062a<\/strong><\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>const [recognized, setRecognized] = useState(\"\");\nconst [pitch, setPitch] = useState(\"\");\nconst [error, setError] = useState(\"\");\nconst [end, setEnd] = useState(\"\");\nconst [started, setStarted] = useState(\"\");\nconst [results, setResults] = useState([]);\nconst [partialResults, setPartialResults] = useState([]);\n\n<\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>\u062c. \u0631\u0627\u0647\u200c\u0627\u0646\u062f\u0627\u0632\u06cc \u06a9\u0646\u062a\u0631\u0644\u200c\u06a9\u0646\u0646\u062f\u0647\u200c\u0647\u0627\u06cc \u0631\u0648\u06cc\u062f\u0627\u062f \u0635\u0648\u062a\u06cc<\/strong><\/p>\n<p>\u062f\u0627\u062e\u0644 <code>useEffect<\/code> \u0647\u0648\u06a9\u060c \u06a9\u0646\u062a\u0631\u0644 \u06a9\u0646\u0646\u062f\u0647 \u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641 \u0631\u0648\u06cc\u062f\u0627\u062f \u0631\u0627 \u0645\u0642\u062f\u0627\u0631\u062f\u0647\u06cc \u0627\u0648\u0644\u06cc\u0647 \u06a9\u0646\u06cc\u062f:<\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>useEffect(() =&gt; {\n  Voice.onSpeechStart = (e) =&gt; {\n    console.log(\"onSpeechStart: \", e);\n    setStarted(\"\u221a\");\n  };\n\n  Voice.onSpeechRecognized = (e) =&gt; {\n    console.log(\"onSpeechRecognized: \", e);\n    setRecognized(\"\u221a\");\n  };\n\n  Voice.onSpeechEnd = (e) =&gt; {\n    console.log(\"onSpeechEnd: \", e);\n    setEnd(\"\u221a\");\n  };\n\n  Voice.onSpeechError = (e) =&gt; {\n    console.log(\"onSpeechError: \", e);\n    setError(JSON.stringify(e.error));\n  };\n\n  Voice.onSpeechResults = (e) =&gt; {\n    console.log(\"onSpeechResults: \", e);\n    setResults(e.value);\n  };\n\n  Voice.onSpeechPartialResults = (e) =&gt; {\n    console.log(\"onSpeechPartialResults: \", e);\n    setPartialResults(e.value);\n  };\n\n  Voice.onSpeechVolumeChanged = (e) =&gt; {\n    console.log(\"onSpeechVolumeChanged: \", e);\n    setPitch(e.value);\n  };\n\n  return () =&gt; {\n    Voice.destroy().then(Voice.removeAllListeners);\n  };\n}, []);\n\n<\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>\u062f \u0634\u0631\u0648\u0639 \u0648 \u062a\u0648\u0642\u0641 \u062a\u0634\u062e\u06cc\u0635<\/strong><\/p>\n<p>\u0628\u0631\u0627\u06cc \u0634\u0631\u0648\u0639\u060c \u062a\u0648\u0642\u0641\u060c \u0644\u063a\u0648 \u06cc\u0627 \u0627\u0632 \u0628\u06cc\u0646 \u0628\u0631\u062f\u0646 \u0634\u0646\u0627\u0633\u0627\u06cc\u06cc\u060c \u062a\u0648\u0627\u0628\u0639 \u0632\u06cc\u0631 \u0631\u0627 \u062a\u0639\u0631\u06cc\u0641 \u06a9\u0646\u06cc\u062f:<\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>const startRecognizing = async () =&gt; {\n  try {\n    await Voice.start(\"en-US\");\n  } catch (e) {\n    console.error(e);\n  }\n};\n\nconst stopRecognizing = async () =&gt; {\n  try {\n    await Voice.stop();\n  } catch (e) {\n    console.error(e);\n  }\n};\n\nconst cancelRecognizing = async () =&gt; {\n  try {\n    await Voice.cancel();\n  } catch (e) {\n    console.error(e);\n  }\n};\n\nconst destroyRecognizer = async () =&gt; {\n  try {\n    await Voice.destroy();\n  } catch (e) {\n    console.error(e);\n  }\n  resetStates();\n};\n\nconst resetStates = () =&gt; {\n  setRecognized(\"\");\n  setPitch(\"\");\n  setError(\"\");\n  setStarted(\"\");\n  setResults([]);\n  setPartialResults([]);\n  setEnd(\"\");\n};\n\n<\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"5_%D9%BE%DB%8C%D8%A7%D8%AF%D9%87_%D8%B3%D8%A7%D8%B2%DB%8C_UI\"><\/span>\n<p>  5. \u067e\u06cc\u0627\u062f\u0647 \u0633\u0627\u0632\u06cc UI<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u0627\u06a9\u0646\u0648\u0646\u060c \u06cc\u06a9 \u0631\u0627\u0628\u0637 \u06a9\u0627\u0631\u0628\u0631\u06cc \u0633\u0627\u062f\u0647 \u0628\u0631\u0627\u06cc \u062a\u0639\u0627\u0645\u0644 \u0628\u0627 \u0633\u06cc\u0633\u062a\u0645 \u062a\u0634\u062e\u06cc\u0635 \u0635\u062f\u0627 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f:<\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code><view style=\"{styles.container}\">\n  <text style=\"{styles.welcome}\">Welcome to React Native Voice!<\/text>\n  <text style=\"{styles.instructions}\">Press the button and start speaking.<\/text>\n  <text style=\"{styles.stat}\">{`Started: ${started}`}<\/text>\n  <text style=\"{styles.stat}\">{`Recognized: ${recognized}`}<\/text>\n  <text style=\"{styles.stat}\">{`Pitch: ${pitch}`}<\/text>\n  <text style=\"{styles.stat}\">{`Error: ${error}`}<\/text>\n  <text style=\"{styles.stat}\">Results<\/text>\n  {results.map((result, index) =&gt; (\n    <text key=\"{`result-${index}`}\" style=\"{styles.stat}\">{result}<\/text>\n  ))}\n  <text style=\"{styles.stat}\">Partial Results<\/text>\n  {partialResults.map((result, index) =&gt; (\n    <text key=\"{`partial-result-${index}`}\" style=\"{styles.stat}\">{result}<\/text>\n  ))}\n  <text style=\"{styles.stat}\">{`End: ${end}`}<\/text>\n\n  <touchablehighlight onpress=\"{startRecognizing}\">\n    <text style=\"{styles.action}\">Start<\/text>\n  <\/touchablehighlight>\n  <touchablehighlight onpress=\"{stopRecognizing}\">\n    <text style=\"{styles.action}\">Stop Recognizing<\/text>\n  <\/touchablehighlight>\n  <touchablehighlight onpress=\"{cancelRecognizing}\">\n    <text style=\"{styles.action}\">Cancel<\/text>\n  <\/touchablehighlight>\n  <touchablehighlight onpress=\"{destroyRecognizer}\">\n    <text style=\"{styles.action}\">Destroy<\/text>\n  <\/touchablehighlight>\n<\/view>\n\n<\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"6_%DB%8C%DA%A9_%D8%B8%D8%A7%D9%87%D8%B1_%D8%B7%D8%B1%D8%A7%D8%AD%DB%8C_%D8%B4%D8%AF%D9%87\"><\/span>\n<p>  6. \u06cc\u06a9 \u0638\u0627\u0647\u0631 \u0637\u0631\u0627\u062d\u06cc \u0634\u062f\u0647<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>const styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: \"center\",\n    alignItems: \"center\",\n    backgroundColor: \"#F5FCFF\",\n    marginTop: 33,\n  },\n  welcome: {\n    fontSize: 20,\n    textAlign: \"center\",\n    margin: 10,\n  },\n  action: {\n    textAlign: \"center\",\n    color: \"#0000FF\",\n    marginVertical: 5,\n    fontWeight: \"bold\",\n  },\n  instructions: {\n    textAlign: \"center\",\n    color: \"#333333\",\n    marginBottom: 5,\n  },\n  stat: {\n    textAlign: \"center\",\n    color: \"#B0171F\",\n    marginBottom: 1,\n  },\n});\n\n<\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"7_%DB%8C%D8%A7%D8%AF%D8%AF%D8%A7%D8%B4%D8%AA_%D9%87%D8%A7\"><\/span>\n<p>  7. \u06cc\u0627\u062f\u062f\u0627\u0634\u062a \u0647\u0627<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>\u062a\u0634\u062e\u06cc\u0635 \u0635\u062f\u0627 \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u062f\u0631 \u0634\u0628\u06cc\u0647 \u0633\u0627\u0632\u0647\u0627\u06cc \u0627\u0646\u062f\u0631\u0648\u06cc\u062f \u06a9\u0627\u0631 \u0646\u06a9\u0646\u062f. \u062a\u0633\u062a \u0628\u0631 \u0631\u0648\u06cc \u06cc\u06a9 \u062f\u0633\u062a\u06af\u0627\u0647 \u0648\u0627\u0642\u0639\u06cc \u062a\u0648\u0635\u06cc\u0647 \u0645\u06cc \u0634\u0648\u062f.<\/li>\n<li>\u062f\u0631 iOS\u060c \u0627\u06af\u0631 \u0645\u062c\u0648\u0632\u0647\u0627\u06cc \u0644\u0627\u0632\u0645 \u0628\u0647 \u062f\u0631\u0633\u062a\u06cc \u0628\u0647 \u0622\u0646 \u0627\u0636\u0627\u0641\u0647 \u0646\u0634\u0648\u062f\u060c \u062e\u0631\u0627\u0628\u06cc \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0631\u062e \u062f\u0647\u062f <code>Info.plist<\/code>.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"%D9%86%D8%AA%DB%8C%D8%AC%D9%87_%DA%AF%DB%8C%D8%B1%DB%8C\"><\/span>\n<p>  \u0646\u062a\u06cc\u062c\u0647 \u06af\u06cc\u0631\u06cc<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u0628\u0627 \u062f\u0646\u0628\u0627\u0644 \u06a9\u0631\u062f\u0646 \u0645\u0631\u0627\u062d\u0644 \u0627\u06cc\u0646 \u0631\u0627\u0647\u0646\u0645\u0627\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 @react-native-voice\/voice\u060c \u0639\u0645\u0644\u06a9\u0631\u062f \u0635\u062f\u0627 \u0628\u0647 \u0645\u062a\u0646 \u0631\u0627 \u0628\u0647 \u0633\u0631\u0639\u062a \u062f\u0631 \u0628\u0631\u0646\u0627\u0645\u0647 React Native \u062e\u0648\u062f \u0627\u062f\u063a\u0627\u0645 \u06a9\u0646\u06cc\u062f. \u0686\u0647 \u062f\u0631 \u062d\u0627\u0644 \u062a\u0648\u0633\u0639\u0647 \u0631\u0627\u0628\u0637 \u0647\u0627\u06cc \u0647\u0646\u062f\u0632\u0641\u0631\u06cc \u0628\u0627\u0634\u06cc\u062f \u0648 \u0686\u0647 \u0628\u0647 \u0633\u0627\u062f\u06af\u06cc \u062a\u0639\u0627\u0645\u0644 \u06a9\u0627\u0631\u0628\u0631 \u0631\u0627 \u0627\u0641\u0632\u0627\u06cc\u0634 \u062f\u0647\u06cc\u062f\u060c \u0627\u06cc\u0646 \u0627\u0628\u0632\u0627\u0631 \u0645\u06cc \u062a\u0648\u0627\u0646\u062f \u0627\u0641\u0632\u0648\u062f\u0646\u06cc \u0642\u062f\u0631\u062a\u0645\u0646\u062f \u0628\u0631\u0627\u06cc \u0628\u0631\u0646\u0627\u0645\u0647 \u0634\u0645\u0627 \u0628\u0627\u0634\u062f.<\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Summarize this content to 400 words in Persian Lang \u0645\u0642\u062f\u0645\u0647 \u062f\u0631 \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647\u060c \u0634\u0645\u0627 \u0631\u0627 \u0628\u0627 \u0627\u062f\u063a\u0627\u0645 \u0622\u0646 \u0622\u0634\u0646\u0627 \u062e\u0648\u0627\u0647\u06cc\u0645 \u06a9\u0631\u062f @react-native-voice\/voice \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0631\u0627 \u062f\u0631 \u067e\u0631\u0648\u0698\u0647 React Native \u0645\u0627 \u0641\u0639\u0627\u0644 \u06a9\u0646\u06cc\u062f voice-to-text \u0639\u0645\u0644\u06a9\u0631\u062f \u0627\u06cc\u0646 \u0648\u06cc\u0698\u06af\u06cc \u0631\u0627 \u0645\u06cc \u062a\u0648\u0627\u0646 \u062f\u0631 \u0633\u0646\u0627\u0631\u06cc\u0648\u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641\u06cc \u0645\u0627\u0646\u0646\u062f \u0628\u0631\u0646\u0627\u0645\u0647 \u0647\u0627\u06cc \u062f\u06cc\u06a9\u062a\u0647\u060c \u0641\u0631\u0645\u0627\u0646 \u0647\u0627\u06cc \u0635\u0648\u062a\u06cc \u06cc\u0627 \u0648\u06cc\u0698\u06af\u06cc \u0647\u0627\u06cc \u062c\u0633\u062a\u062c\u0648 \u0628\u0647 \u0635\u0648\u0631\u062a \u0635\u0648\u062a\u06cc &hellip;<\/p>\n","protected":false},"author":2,"featured_media":85751,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","footnotes":""},"categories":[339],"tags":[],"class_list":["post-85750","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dev"],"_links":{"self":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts\/85750","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/comments?post=85750"}],"version-history":[{"count":0,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts\/85750\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/media\/85751"}],"wp:attachment":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/media?parent=85750"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/categories?post=85750"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/tags?post=85750"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}