This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This class represents an authentication middleware used in a web application. | |
export class AuthMiddleware extends BaseRouterMiddleware { | |
protected appUtils: AppUtils; | |
protected loginSessionService: LoginSessionService; | |
constructor(appRouter: Router) { | |
super(appRouter); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return ( | |
<SafeAreaView style={styles.main}> | |
<Text style={styles.head}> | |
Agora Interactive Live Streaming Quickstart | |
</Text> | |
<View style={styles.btnContainer}> | |
<Text onPress={join} style={styles.button}> | |
{isJoinLoading ? 'Joining...' : ' Join'} | |
</Text> | |
<Text onPress={leave} style={styles.button}> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const startTranscribe = async () => { | |
setIsTranscribing(true); | |
const recordingPath = `${RNFS.DocumentDirectoryPath}/audioRecordings`; | |
const fileName = 'recording.wav'; | |
const filePath = `${recordingPath}/${fileName}`; | |
// Read the contents of the recorded file | |
if (!(await RNFS.exists(recordingPath))) { | |
await RNFS.mkdir(recordingPath); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const leave = async () => { | |
setLeaveLoading(true); | |
try { | |
agoraEngineRef.current?.leaveChannel(); | |
agoraEngineRef.current | |
?.getMediaEngine() | |
.unregisterAudioFrameObserver(iAudioFrameObserver); | |
console.log('stop recording '); | |
agoraEngineRef.current?.stopAudioRecording(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const leave = async () => { | |
setLeaveLoading(true); | |
try { | |
agoraEngineRef.current?.leaveChannel(); | |
agoraEngineRef.current | |
?.getMediaEngine() | |
.unregisterAudioFrameObserver(iAudioFrameObserver); | |
console.log('stop recording '); | |
agoraEngineRef.current?.stopAudioRecording(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const join = async () => { | |
setJoinLoading(true); | |
resetTranscribedData(); | |
const recordingPath = `${RNFS.DocumentDirectoryPath}/audioRecordings`; | |
RNFS.mkdir(recordingPath); | |
const fileName = 'recording.wav'; | |
const filePath = `${recordingPath}/${fileName}`; | |
await RNFS.unlink(filePath).catch(error => { | |
console.log('Error deleting file:', error); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useRef, useState, useEffect} from 'react'; | |
import { | |
SafeAreaView, | |
ScrollView, | |
StyleSheet, | |
Text, | |
View, | |
Switch, | |
ActivityIndicator, | |
} from 'react-native'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useRef, useState, useEffect} from 'react'; | |
import { | |
SafeAreaView, | |
ScrollView, | |
StyleSheet, | |
Text, | |
View, | |
Switch, | |
ActivityIndicator, | |
} from 'react-native'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import {Text, View, StyleSheet} from 'react-native'; | |
const TranscribedOutput = ({transcribedText, interimTranscribedText}: any) => { | |
if (transcribedText.length === 0 && interimTranscribedText.length === 0) { | |
return <Text>...</Text>; | |
} | |
return ( | |
<View style={styles.box}> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface IData { | |
name?: string; | |
department?: string; | |
teamlead?: string; | |
role?: string; | |
location?: string; | |
lga?: string; | |
country?: string; | |
due_date?: string; | |
children?: JSX.Element | JSX.Element[]; |
NewerOlder