American Truck Simulator

American Truck Simulator

67 valoraciones
Find & Import Radio Stream URLs (& Local Files!)
Por Gabe Valentine
This guide teaches you how to find & use radio stream URLs to add custom radio stations (allowing you to listen to your favorite local stations in-game), combine the default radio stations from ETS2 & ATS, and how to play local files in-game.
   
Premiar
Favoritos
Favorito
Quitar
Introduction
I made a fairly popular guide which adds a couple hundred real U.S. radio stations to the game. This guide will teach you how to find and use radio stream URLs to program custom radio stations for your truck, allowing you to listen to your favorite local stations in-game. It also covers how to use codecs that the game does not support, how to listen to local files with the in-game radio, how to merge the default radio stations from ETS2 with the default stations from ATS, and how to automate local transcoding with the CLI.

If you're interested in something ready-to-use, check out my other guide: Real US Radio, 200+ Stations.

Almost every radio station has an online stream and you can import such a URL by editing the live_streams.sii file located in ~\Users\YOU\Documents\Euro Truck Simulator 2 or ~\Documents\American Truck Simulator.

There several files types you will encounter:
  • .PLS[en.wikipedia.org]
  • .MP3[en.wikipedia.org]
  • .AAC[en.wikipedia.org] / MP4A: These are the formats used in HTTP Live Streaming (HLS) which is now commonly used for live radio streams but will not work with the game.
  • .M3U[en.wikipedia.org] or .M3U8[en.wikipedia.org]: These are 'playlist' formats that can be single- or multi-entry; each entry will point to a stream. They are plain text files and can be opened with notepad++ or notepad. M3U8 files may also include directives and comments prefaced by a hash/pound (#).

    Every link in live_streams.sii should be formatted like this:

    stream_data[Number]: "URL|Name|Genre|Language|Bitrate|Favorite"

    • Number is unique stream id number, used by the game to organize the list.
    • URL is the direct link.
    • Name is in-game description of station.
    • Genre can be changed for organizing preferences.
    • Language is for broadcast language.
    • Bitrate. This is not autodetected by the game. You can set it to any number or leave it blank.
    • Favorite is boolean, 0 or 1.
Utilities and Tools
  • Chrome, Firefox, or another web browser with developer console. Press F12 to open this.
  • To actively transcribe a stream (see below) you will need VLC media player. VLC is a great way to test listen to streams before you import them to the game, and also a fantastic day-to-day media player. https://www.videolan.org/vlc/
  • (optional) URL Snooper 2 is a program used to analyze your computer's network traffic "to help users locate the urls of audio and video files so that they can be recorded." This can help with websites that obfuscate their media URLs. http://www.donationcoder.com/software/mouser/popular-apps/url-snooper
Finding and Importing URLs
The first step is to look at the stream on the official website. Many stations in the U.S. use iHeartRadio, such as Kiis FM 102.7 Los Angeles. iHeartRadio always uses the .aac/mp4a format and cannot be used with ETS2 or ATS. There is a workaround in the next section covering how to use .aac streams.

The example station I will use is FM Aspen 102.3 Buenos Aires. The official website for this station is fmaspen.com. This station's stream can be obtained using only your web browser. You will not need VLC or URLsnooper.

Navigate to the media player of the site and press F12 in your web browser to open developer console (ctrl+shift+J also works) and select the "Network" tab. Press play and you should see the media URLs in the network traffic console. The media file playing at player.fmaspen.com is http://18183.live.streamtheworld.com/ASPENAAC.aac.

Since this stream is .aac it cannot be used with the game. We need an .mp3 file.

The next step is to look for sites that rebroadcast this station. Head to a search engine looking for "apsen 102.3 stream." Test each site's stream, continuing to use the network monitor to see the stream's file format. The first .mp3 file on my search results was from streema.com at http://20283.live.streamtheworld.com/ASPEN.mp3. There is also an mp3 stream from radio.net at http://20833.live.streamtheworld.com/ASPEN.mp3.

The quality seems about the same on these. Both use a lower sample rate and bitrate (which lowers the quality of the stream) than the official website's .aac stream. This may be the quality that Aspen provides to these sites or they may be transcoding the file at a lower quality.

Copy the URL and format your stream_data entry following the format in the introduction section, then add it to your live_streams.sii file. If you copy this entry, replace the ??? with the next number in your current file.
stream_data[???]: "http://20283.live.streamtheworld.com/ASPEN.mp3|FM Aspen 102.3 Buenos Aires|80s|ES|64|0"
Using MP4A / AAC files (or local files) in-game
If you add an AAC stream to your live_streams file, it won't work. However, I picked up a trick from Kevin O'Connor[kevo.io] to fix this.

Here is an example URL of an mp4a stream (102.7 KIIS FM, Los Angeles):
http://c2icyelb.prod.playlists.ihrhls.com/185_icy


1. Test the stream. Open VLC, press ctrl+N, paste the stream URL, and play.
2. We will locally transcode this stream. Press ctrl+S.
3. Here you can see that VLC can transcode and stream several types of sources: local files, disc, network, or capture device. Select network. If the URL is not already there, paste it. Click stream to open the stream output wizard. Click next.
4. In the new destination drop-down, select HTTP. Click add.
5. Leave default, this will use localhost port 8080. If you have used port 8080 then choose another. Click next.
6. Active transcoding must be selected on this screen. Change profile to audio - mp3. Click next.
7. Click stream.
8 (first time only). Your firewall might prompt you then to allow VLC. If it doesn't, verify that VLC has been allowed through your firewall.

VLC will begin playing but you will not hear any audio through your speakers/headset. Instead, the local mp3 stream can now be accessed at http://localhost:8080. That is what we add to live_streams.sii, replacing the ??? with the next number in your current file.

You can verify audio is playing by opening a second instance of VLC, press ctrl+N, and enter the network URL (http://localhost:8080). You will hear the audio that is being transcoded by the first instance of VLC.

stream_data[???]: "http://localhost:8080|102.7 KIIS FM Los Angeles|Pop|EN|128|0"

Now you can open the game and play your station. You'll need to leave VLC open while you play.
Working with playlist.m3u8 files (iHeart) - Updated 10 Sep. 2019
iHeart obfuscates their streams, making it somewhat more difficult to obtain a file for local transcoding. This section will cover where to find this file and some of its key components. The stream will be organized and split into chunks contained in .m3u8 files.

For this example I will be using WDXB 102.5 FM of Birmingham. Here is the iHeart URL to listen to the station[www.iheart.com].

Open the "Network" tab of the developer tools (F12), and play the station. As soon as the station's audio begins, you can stop the stream. Sort the files by name. There are "playlist.m3u8?listeningSessionID=BigStringHere" files. More of these will appear the longer we listen to the station. These are the chunks or parts of the stream. You can click these and see that they point to the subdomain "cdn-chunks.prod". Each chunk is an AAC/MP4a file. We don't need these.

We are looking for the file named "playlist.m3u8?init_id=NumbersAndStuff"[i.imgur.com]. This is the playlist file that initialized the connection. If you click this file, you will see a link to the station stream and the port in use[i.imgur.com]. If you enter the highlighted URL, you will download a file that can be played in VLC and contains the following if opened in Notepad++ (bottom part of last image):


This file points to "c4.prod.playlists" and the URL includes a port (443) in addition to the station identifier (3089). We can tell that this is an mp4a stream from the track information directive where it says codecs="mp4a.40.5". This is the file we can use for local transcoding. Copy everything up to the question mark and follow the instructions in the section above (Using MP4A files in-game).


Now that we understand the naming structure, it becomes easy to grab new links for transcoding. The station identifier is listed all over the place, including the URL of the station. The port is always 443 for iHeart. So all you need to format your own link is to press play on the station and identify which iHeart server the station lives on (c1, c2, c3, c4).

Merging default stations from ATS and ETS2
You can combine all the default stations into one live_streams.sii file and use it in both games. You will need to own and install both games.

1. Run each game and select radio. Press "update from internet."
2. Navigate to the ~\Documents\Euro Truck Simulator 2 folder and open live_streams.sii.
3. Copy everything from "stream_data[0]" down to the last station (don't copy the curly brackets at the end of the file).
4. Navigate to ~\Documents\American Truck Simulator and open the live_streams.sii file there.
5. Paste above "stream_data[0]" then head to the end of the list. Rename everything in sequential order. If the last number you pasted was 235, the "stream_data[0]" below it will become 236. Do this for all 38 default ATS stations then save the file.
6. Copy the live_streams.sii file from the ~\Documents\American Truck Simulator into ~\Documents\Euro Truck Simulator 2 and replace when prompted.
(Advanced Users) Using CLI to start local transcoding
This is only for users who are comfortable using Command Prompt or other command line interface. This section will allow you to start streams using a single command.

For this tutorial I will be using WCKA 810AM / 94.3FM Alabama. The stream can be accessed at this URL. This is INPUT.


First, open the command line. You can do this by pressing windows+R and typing "cmd" or a shortcut can be found in the Start Menu under "Windows System" folder.

Navigate to your VLC installation folder. The default path is below.

cd C:\Program Files\VideoLAN\VLC

Next, open VLC by typing "vlc". Follow the instructions under "Using MP4A / AAC files in-game" up to step 6. The last screen of the Stream Output Wizard provides a generated stream output string which you will copy. Here is the string we get for WCKA.

:sout=#transcode{vcodec=none,acodec=mp3,ab=128,channels=2,samplerate=44100,scodec=none}:http{mux=mp3,dst=:8080/} :no-sout-all :sout-keep

Unfortunately, in the current release of VLC, this string is not expressed in the way Command Prompt is expecting so we will need to fix it before it can be used. Paste the string into your preferred text editor for a moment and close VLC.

Below is the desired formatting. VLC's documentation is not user friendly, very complete, or up-to-date. However, more information on using VLC with the CLI can be found here[wiki.videolan.org] and command line examples can be found here[wiki.videolan.org].

vlc "INPUT" --sout "#transcode{STREAM SETTINGS}:http{mux=CODEC,dst=:OUTPUTPORT}" :no-sout-all :sout-keep

Here is the completed command to transcode WCKA to mp3 and output to localhost port 8080. Compare this to the generated output string.

vlc "https://ice64.securenetsystems.net/WCKA" --sout "#transcode{acodec=mp3,ab=128,channels=2,samplerate=44100,scodec=none}:http{mux=mp3,dst=:8080}" :no-sout-all :sout-keep

Copy your formatted command and paste to Command Prompt (make sure you are in VLC's installation directory). When you run the command, VLC should open and begin streaming.

Open a new VLC window and test your stream. Any errors will be displayed under "messages" (ctrl+M) or in a pop-up error window. If you receive an error that VLC media player could not start because "either the command line options were invalid or no plugins were found" this means you have an error in your command expression.
Enjoy!
Please post any questions you have in the comments. I use these questions to add additional tutorials for situations that the guide doesn't yet cover. Your questions may help other users and will help me improve on this resource.

Thanks for viewing this guide, if it is helpful to you please rate thumbs up.
36 comentarios
FatAngryBeaver 28 MAR a las 0:17 
For those interested there's a mod that adds about 300+ stations to the radio thing. I'm sure you can mod the list with your own streams once you get the URL. For those who are a little less tech savvy.

https://steamcommunity.com/sharedfiles/filedetails/?id=975427716
vjgamz88 27 JUN 2024 a las 16:12 
hello, for some reason going to the localhost8080 did nothing. it just says "refused to connect". i made sure to allow VLC through my firewall. any fix?
Gabe Valentine  [autor] 18 ABR 2024 a las 2:06 
The formats will be the same worldwide. You are looking at the 'chunk' files of an AAC stream. The initial file will either point to the AAC directly or will be an m3u8. The file will have slightly different domain than the subsequent files, similar to what I discuss in the playlist.m3u8 section. It will be the first file in the waterfall, so that is how you can identify the one you would need. It may pre-load, so open the network inspector first using F12 then hit F5 to refresh the page to make sure it is in the results.
Asqhalt 18 ABR 2024 a las 1:55 
in particular I'm trying to add Chinese and Japanese radio stations. Is their formatting different to those of the US's and Canada's?
Asqhalt 18 ABR 2024 a las 1:54 
I've tried world radio map and station websites, the first m3u8 is a playlist that is similar to the one in your screenshot, and the subsequent m3u8's are just audio clips of a couple seconds
Gabe Valentine  [autor] 13 ABR 2024 a las 10:52 
World Radio Map is another good one.
Gabe Valentine  [autor] 13 ABR 2024 a las 10:06 
Most of the time I use the station's website, or TuneIn, or one of a dozen radio stream directories. Make sure you have the network inspector open when the page loads. The m3u8 are just playlists, they should point to AAC or MP3 files (usually AAC).
Asqhalt 11 ABR 2024 a las 22:56 
what website do you use to find this stuff? the past 20 or 30 use m3u8 and they have no affiliation with iheartradio. putting c1 to c4 in front of the url did not do anything either.
CypherConjured 21 NOV 2022 a las 19:40 
Is there some way to turn the volume up or down on these? Some are way louder than others...
Weird Uncle 14 FEB 2021 a las 21:56 
ive been having troublewith this. everything works fine, and it streams through VLC, but after transponding them, VLC cannot find a localhost, hence, the sound isnt coming out or being streamed through it