# Streaming Web Audio

### Streaming Web Audio

You can now stream live radio stations and more in Sansar. We support various formats like Shoutcast, Icecast, and other services using MP3-based URLs.

**Note**: OGG format also works, but AAC format is not supported.

**Streaming web audio in Sansar**

There are currently two ways to stream web audio in Sansar: (1) using an audio emitter or (2) the [Scene Settings](https://help.sansar.com/hc/en-us/articles/115003183343-Scene-Settings) menu.

For both ways, you can click **Options** > [**Audio Preview**](https://help.sansar.com/hc/en-us/articles/115002178966-Audio-Preview) on the toolbar in the upper-left corner of the screen to test the audio in your scene. If it's a valid stream, you should hear the sound start shortly.

|                                                        |
| ------------------------------------------------------ |
| Sansar Video Tutorial - Setting Up A Web Audio Stream. |

Stream audio using an audio emitter

To stream web audio in Sansar using an audio emitter:

1. Add an [audio emitter](https://docs.sansar.com/latest/creating-in-sansar/working-with-audio-and-video/audio-emitter) in a scene. You can learn more about adding audio emitters [here](https://docs.sansar.com/latest/creating-in-sansar/working-with-audio-and-video/audio-emitter).
2. Select the audio emitter to show its contextual menu, and click the properties ![properties\_button.png](https://i3.wp.com/help.sansar.com/hc/article_attachments/115014330526/properties_button.png) button.
3. On the Properties panel, set the Sound Source to **Stream**. This changes the Sound field to **Stream**.
4. In the **Stream** dropdown, choose one of the [audio or media streams you defined](https://help.sansar.com/hc/en-us/articles/115003259666) in the [Scene Settings](https://help.sansar.com/hc/en-us/articles/115003183343-Scene-Settings) under Web Audio Streams or Media Surface Settings.

An audio emitter set to Stream is treated like any other sound in Sansar, which means that the sound is spatialized and can be an immersive part of in-scene sound. And just like any other emitter, you can change its shape to a cuboid or sphere to fill a larger area with sound, as shown here:

| ![audioemitter-streamURL01.png](https://i3.wp.com/help.sansar.com/hc/article_attachments/360000305983/streaming_audio_emitter.png) |
| ---------------------------------------------------------------------------------------------------------------------------------- |
| The Audio Emitter properties panel with Stream set as the Sound Source.                                                            |

**Stream audio as a background sound**

To stream web audio in Sansar as a scene sound:

1. Click on **Tools** > [**Scene Settings**](https://help.sansar.com/hc/en-us/articles/115003183343) on the toolbar to open the Scene Properties panel.
2. In the Scene Properties panel, scroll down to the Background Sound section.
3. Set the Sound Source to **Stream**. This changes the Sound field to **Stream**.
4. In the **Stream** dropdown, choose one of the [audio or media streams you defined](https://help.sansar.com/hc/en-us/articles/115003259666) in the Scene Settings under Web Audio Streams or Media Surface Settings.

If you stream web audio using the scene settings, the sound is non-spatialized, meaning it's not coming from within the scene, and is the same volume regardless of camera position. Be careful what you set the Loudness level to, because if it's too loud, your in-scene sounds will be drowned out and visitors will have a hard time using voice chat to communicate.

| ![scenesettings-streamURL01.png](https://i3.wp.com/help.sansar.com/hc/article_attachments/360000306003/streaming_background_sound.png) |
| -------------------------------------------------------------------------------------------------------------------------------------- |
| The scene settings properties panel with Stream set as the Sound Source under sound settings.                                          |

**Getting web audio stream URLs from websites**

Getting the link to an audio stream is pretty easy, as some websites provide the link directly. Simply copy and paste the link right into Sansar.

If you're used to streaming audio in media players such as iTunes, they usually have an option to copy the Stream URL.

**Shoutcast directory**

For example, to get URLs from the popular Shoutcast directory:

1. Go to [shoutcast.com](http://shoutcast.com/) .
2. Click a genre you like.
3. Click the **Play** button to preview a station.
4. Once you've decided on a station you want to stream in Sansar, click the **Download** button to open a dropdown.
5. On the dropdown, choose **Any player (.m3u)** to start downloading the file. (The other formats work too, if you know how to parse the files.)
6. Find the downloaded file on your hard drive.
7. Right-click the file and use **Open with** to open it in a text editor like [Notepad++](https://notepad-plus-plus.org/). (The built-in Windows Notepad tends to show separate lines bunched together, which can make it harder.)
8. In the text file, you'll see several lines, and the Shoutcast audio stream, which starts with **http\://**. For example, [http://178.33.232.230:8000](http://178.33.232.230:8000/) or [http://50.7.53.3:80/tuner24-01](http://50.7.53.3/tuner24-01) (These were working at the time this article was published.)
9. Copy and paste that URL into the Sansar Stream URL field.

#### Have more questions? Ask in our [Discord!](http://discord.gg/sansarofficial)
