# Audio playback from a file

**URL:** <https://devforum.zoom.us/t/audio-playback-from-a-file/120266>\
**Category:** Video SDK\
**Tags:** recording, video-sdk\
**Created:** [November 4, 2024, 8:27am UTC](https://devforum.zoom.us/t/audio-playback-from-a-file/120266 "2024-11-04T08:27:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/omar/32/54117_2.png) [@omar](https://devforum.zoom.us/u/omar)\
**Post date:** [November 4, 2024, 8:27am UTC](https://devforum.zoom.us/t/audio-playback-from-a-file/120266/1 "2024-11-04T08:27:17Z")

</div>

I have a web app built with React using videosdk. The core function is for a single human user to join the session and record their audio in response to some audio prompts. I want these programmatically run audio prompts to be in the cloud recording too, so is there a way to programmatically run audio from an audio file within the videosdk session?

getAudioMediaPlaybackController seems to hint at something like this but I can’t quite figure it out.

Appreciate if somebody can help me out with this.

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [November 4, 2024, 8:52am UTC](https://devforum.zoom.us/t/audio-playback-from-a-file/120266/2 "2024-11-04T08:52:06Z")

</div>

Hey @omar

Thanks for your feedback.

Video SDK supports using a media file(mp3, mp4,wav, etc.) as the audio input. You can invoke it as follows:

```javascript
const stream = client.getMediaStream();
await stream.startAudio({ mediaFile: { url: mediaPlaybackUrl, loop: true } });
const audioPlaybackController = stream.getAudioMediaPlaybackController();

//Pause the audio
await audioPlaybackController.pause();
//Resume the audio
await audioPlaybackController.play();

```

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/omar/32/54117_2.png) [@omar](https://devforum.zoom.us/u/omar)\
**Post date:** [November 4, 2024, 10:58am UTC](https://devforum.zoom.us/t/audio-playback-from-a-file/120266/3 "2024-11-04T10:58:57Z")

</div>

TypeError: stream.startAudio is not a function

I’m getting this error. Any idea why this would be happening?
