Skip to content

Instantly share code, notes, and snippets.

@dueka
Created April 29, 2023 14:52
Show Gist options
  • Save dueka/f37195653af050c7c16dd460e9c74e22 to your computer and use it in GitHub Desktop.
Save dueka/f37195653af050c7c16dd460e9c74e22 to your computer and use it in GitHub Desktop.
App.tsx
import React, {useRef, useState, useEffect} from 'react';
import {
SafeAreaView,
ScrollView,
StyleSheet,
Text,
View,
Switch,
ActivityIndicator,
} from 'react-native';
import {PermissionsAndroid, Platform} from 'react-native';
import RNFS from 'react-native-fs';
import RNFetchBlob from 'rn-fetch-blob';
import {
ClientRoleType,
RawAudioFrameOpModeType,
AudioFrame,
createAgoraRtcEngine,
IRtcEngine,
RtcSurfaceView,
ChannelProfileType,
AudioFileRecordingType,
} from 'react-native-agora';
import axios from 'axios';
import FormData from 'form-data';
import TranscribedOutput from './src/components/TranscribeOutput';
const uid = 0;
const appId = '<Agora App ID>';
const token = '<channel token>';
const channelName = 'agoraReactNativeStream';
const OPEN_API_KEY = '';
const SAMPLE_RATE = 16000;
const SAMPLE_NUM_OF_CHANNEL = 1;
const SAMPLES_PER_CALL = 1024;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment