# Audio recording does not work in mobile browsers

**URL:** <https://forum.deepar.ai/t/audio-recording-does-not-work-in-mobile-browsers/711>\
**Category:** Help & Questions\
**Tags:** web-sdk\
**Created:** [June 21, 2024, 2:27pm UTC](https://forum.deepar.ai/t/audio-recording-does-not-work-in-mobile-browsers/711 "2024-06-21T14:27:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArtiomE](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.deepar.ai/artiome/32/893_2.png) [@ArtiomE](https://forum.deepar.ai/u/ArtiomE)\
**Post date:** [June 21, 2024, 2:27pm UTC](https://forum.deepar.ai/t/audio-recording-does-not-work-in-mobile-browsers/711/1 "2024-06-21T14:27:31Z")

</div>

I’m using DeepAR in my Next.JS + React.JS app to record videos. Why am I trying to record a video with audio recording, the following exception is thrown in mobile browsers:

```auto
InvalidStateError: Failed to execute 'encode' on 'AudioEncoder': Cannot call 'encode' on a closed codec.
Call Stack
Object.write
webpack-internal:\node_modules\.pnpm\deepar@5.6.5\node_modules\deepar\js\deepar.esm.js (2:483429)

```

DeepAR version: 5.6.5  
Next.JS version: 14.2.4  
I initialize the library and record a video with audio as shown in the getting started documentation.

Thanks for advance for your help!

---

<div class="post-metadata">

**Author:** ![igor](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.deepar.ai/igor/32/547_2.png) [@igor](https://forum.deepar.ai/u/igor)\
**Post date:** [June 27, 2024, 10:02am UTC](https://forum.deepar.ai/t/audio-recording-does-not-work-in-mobile-browsers/711/2 "2024-06-27T10:02:54Z")

</div>

Can you paste the code snippet?  
The recording with audio is working normally in my testing (on our quickstart). So it might be up to how you have the SDK usage set up.
