Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions examples/speech-to-text/screens/SpeechToTextScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const float32ArrayFromPCMBinaryBuffer = (b64EncodedBuffer: string) => {

export const SpeechToTextScreen = () => {
const {
isModelGenerating,
isModelReady,
isGenerating,
isReady,
downloadProgress,
sequence,
error,
Expand Down Expand Up @@ -74,9 +74,9 @@ export const SpeechToTextScreen = () => {
};

const buttonDisabled =
modalVisible || isModelGenerating || !isModelReady || isRecording;
modalVisible || isGenerating || !isReady || isRecording;
const recordingButtonDisabled =
modalVisible || !isModelReady || DeviceInfo.isEmulatorSync();
modalVisible || !isReady || DeviceInfo.isEmulatorSync();

return (
<>
Expand Down Expand Up @@ -114,7 +114,7 @@ export const SpeechToTextScreen = () => {
}
>
{sequence ||
(isModelGenerating && 'Transcribing...') ||
(isGenerating && 'Transcribing...') ||
'Start transcription...'}
</Text>
</View>
Expand Down Expand Up @@ -179,7 +179,7 @@ export const SpeechToTextScreen = () => {
]}
>
<TouchableOpacity
disabled={recordingButtonDisabled || isModelGenerating}
disabled={recordingButtonDisabled || isGenerating}
style={[
styles.recordingButton,
recordingButtonDisabled && {
Expand Down
8 changes: 4 additions & 4 deletions src/hooks/natural_language_processing/useSpeechToText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { SpeechToTextController } from '../../controllers/SpeechToTextController
import { ResourceSource } from '../../types/common';

interface SpeechToTextModule {
isModelReady: boolean;
isModelGenerating: boolean;
isReady: boolean;
isGenerating: boolean;
sequence: string;
downloadProgress: number;
error: Error | undefined;
Expand Down Expand Up @@ -61,8 +61,8 @@ export const useSpeechToText = ({
}, [model, modelName, encoderSource, decoderSource, tokenizerSource]);

return {
isModelReady: isReady,
isModelGenerating: isGenerating,
isReady,
isGenerating,
downloadProgress,
sequence: sequence,
error: error,
Expand Down