title: How can I play a sound after recording in React Native Expo?
body: <p>I'm building a voice recording application with Expo.
  This is my function to start voice recording, it works properly.</p>
  <pre><code>  const [recording, setRecording] = React.useState();
  
    async function startRecording() {
      try {
        console.log('Requesting permissions..');
        await Audio.requestPermissionsAsync();
        await Audio.setAudioModeAsync({
          allowsRecordingIOS: true,
          playsInSilentModeIOS: true,
        }); 
        console.log('Starting recording..');
        const recording = new Audio.Recording();
        await recording.prepareToRecordAsync(Audio.RECORDING_OPTIONS_PRESET_HIGH_QUALITY);
        await recording.startAsync(); 
        setRecording(recording);
        console.log('Recording started');
      } catch (err) {
        console.error('Failed to start recording', err);
      }
    }
  </code></pre>
  <p>And this is my 'stop' function, Recording stopped and stored...</p>
  <pre><code>  async function stopRecording() {
      console.log('Stopping recording..');
      setRecording(undefined);
      await recording.stopAndUnloadAsync();
      const uri = recording.getURI(); 
      console.log('Recording stopped and stored at', uri);
    }
  </code></pre>
  <p>Now I want to play this saved sound with a play button. How can I reach this saved sound?</p>
  <pre><code>  return (
      &lt;View style={styles.container}&gt;
        &lt;Button
          title={recording ? 'Stop Recording' : 'Start Recording'}
          onPress={recording ? stopRecording : startRecording}
        /&gt;
      &lt;/View&gt;
    );
  </code></pre>
  <p>I want to pass this stored uri as a file location. Is it possible in this way?</p>
  <pre><code>async function playSound() {
      console.log('Loading Sound');
      const { sound } = await Audio.Sound.createAsync(
         require(RecordedURI)
      );
      setSound(sound);
      console.log('Playing Sound');
      await sound.playAsync();
  }
  </code></pre>
  <p>This is the snack link: <a href="https://snack.expo.io/ZN9MBtpLd" rel="nofollow noreferrer">https://snack.expo.io/ZN9MBtpLd</a></p>