Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async _findSong() {
// Audio.setAudioModeAsync()
const {status} = await Audio.requestPermissionsAsync();
console.log('Current Status ' + status);
const recording = new Audio.Recording();
try {
await Audio.setAudioModeAsync({
playsInSilentModeIOS: true,
allowsRecordingIOS: true,
});
const recordOptions = {
android: {
extension: '.m4a',
outputFormat: Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_MPEG_4,
audioEncoder: Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AAC,
sampleRate: 44100,
numberOfChannels: 2,
bitRate: 128000,
},