# Play Audio Natively in the Browser

```javascript
/**
 * @param group : motion group name
 * @param no : index number inside the motion group
 */
// Play sound
const motionSoundFileName = this._modelSetting.getMotionSoundFileName(group, no);
const sound = new Audio(`${this._modelHomeDir}/${motionSoundFileName}`);
let promise = sound.play();
if (promise) {
  // Older browsers may not return a promise, according to the MDN website
  promise.catch(function (error) { console.error(error); });
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://r3dhummingbird.gitbook.io/live2d-cubism-cookbook/web-sdk/play-audio-natively-in-the-browser.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
