> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nameshouts.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Audio files

> Build a playable URL from a name's audio path

You can get the path of the audio file from the Name Object (`path_directory`). Please note that all our audio files are in .mp3 format.

## NameShouts library names

The path for the audio will be:

```text theme={"system"}
https://nslibrary01.blob.core.windows.net/ns-audio/{path value}.mp3
```

Note that the file type (.mp3) needs to be concatenated with our path value. For example, `albert_de` becomes:

```text theme={"system"}
https://nslibrary01.blob.core.windows.net/ns-audio/albert_de.mp3
```

## User-recorded names

The path for the audio for a recorded name (`is_custom` is true) is different from our default names:

```text theme={"system"}
https://nslibrary01.blob.core.windows.net/user-uploads/{path_directory}
```

## Example

```javascript theme={"system"}
const res = await fetch("https://api.nameshouts.com/api/v2.0/name/albert/german", {
  headers: { Authorization: `Bearer ${token}` },
});
const data = await res.json();

const name = data.name_res?.[0];
if (name) {
  const url = `https://nslibrary01.blob.core.windows.net/ns-audio/${name.path_directory}.mp3`;
  new Audio(url).play();
} else {
  console.log("Not found. Similar names:", data.sim_names);
}
```

## Language IDs

Name objects return a `language_id`. To get the language name, match it against `lang_id` from [Get All Visible Languages](https://docs.nameshouts.com/api-reference/languages/get-all-languages.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.