<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alomgir</title>
    <description>The latest articles on DEV Community by Alomgir (@alomgir27).</description>
    <link>https://dev.to/alomgir27</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1266478%2F29f9591b-f156-4492-b3fe-24056f9773f1.jpeg</url>
      <title>DEV Community: Alomgir</title>
      <link>https://dev.to/alomgir27</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alomgir27"/>
    <language>en</language>
    <item>
      <title>How to integrate AWS Real-time transcription using expo-av react native android</title>
      <dc:creator>Alomgir</dc:creator>
      <pubDate>Fri, 26 Jan 2024 10:33:23 +0000</pubDate>
      <link>https://dev.to/alomgir27/how-to-integrate-aws-real-time-transcription-using-expo-av-1o0k</link>
      <guid>https://dev.to/alomgir27/how-to-integrate-aws-real-time-transcription-using-expo-av-1o0k</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const startRecording = async () =&amp;gt; {
        try {
            const { status } = await Audio.getPermissionsAsync();
            if (status !== 'granted') {
                alert('You need to enable permissions in settings');
                return;
            }
            setIsRecordingActive(true);
            await Audio.setAudioModeAsync({
                allowsRecordingIOS: true,
                playsInSilentModeIOS: true,
            });

            const { recording } = await Audio.Recording.createAsync(Audio.RecordingOptionsPresets.HIGH_QUALITY);
            recording?.setProgressUpdateInterval(1000);
            setRecording(recording);

        } catch (error) {
            console.log(error);
            console.log('error');
        }
    }



const stopRecording = async () =&amp;gt; {
        try {
            setRecording(null);
            setIsRecordingActive(false);
            await recording.stopAndUnloadAsync();
            await Audio.setAudioModeAsync({
                allowsRecordingIOS: false,
                playsInSilentModeIOS: false,
            });
            const uri = recording.getURI();
            const info = await FileSystem.getInfoAsync(uri);



        } catch (error) {
            console.log(error);
        }
    }

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I recently followed this repo &lt;a href="https://github.com/ajredniwja/transcribe-example/blob/master/example.js"&gt;link&lt;/a&gt; but my code doesn't work I think it's an encoding problem. expo-av create '.m4a' file but it's needs  those&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;"pcm" || "ogg-opus" || "flac"&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
 formats I tried with this also&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RecordingOptionsPresets.HIGH_QUALITY = {
  isMeteringEnabled: true,
  android: {
    extension: '.m4a',
    outputFormat: AndroidOutputFormat.MPEG_4,
    audioEncoder: AndroidAudioEncoder.AAC,
    sampleRate: 44100,
    numberOfChannels: 2,
    bitRate: 128000,
  },
  ios: {
    extension: '.m4a',
    outputFormat: IOSOutputFormat.MPEG4AAC,
    audioQuality: IOSAudioQuality.MAX,
    sampleRate: 44100,
    numberOfChannels: 2,
    bitRate: 128000,
    linearPCMBitDepth: 16,
    linearPCMIsBigEndian: false,
    linearPCMIsFloat: false,
  },
  web: {
    mimeType: 'audio/webm',
    bitsPerSecond: 128000,
  },
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://docs.expo.dev/versions/latest/sdk/audio/"&gt;link&lt;/a&gt; but nothing working How to solve it? Does anybody have any idea?&lt;/p&gt;

&lt;p&gt;my approach for recording is to convert it to uriToBlob and make it a file, and upload it to local storage It is similar to the example code but repo audio worked perfectly and not mine.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>android</category>
      <category>ai</category>
      <category>av</category>
    </item>
  </channel>
</rss>
