Dream Car ships with 16 preset SoundHelix tracks and a live URL input that lets you queue any direct MP3 link without touching a line of code. For a permanent playlist change, you only need to edit one array inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JustADev1024/threejs-car/llms.txt
Use this file to discover all available pages before exploring further.
index.html.
At runtime (no code changes)
The control panel at the bottom of the screen has a text field and an Add button for adding tracks on the fly:Paste a direct MP3 URL
Type or paste a URL that ends in
.mp3 into the input labelled β Direct MP3 link (from Newgrounds or other site) and click β Add.Select the track
The new track appears at the bottom of the track dropdown. Choose it from the list.
addCustomTrack():
- The URL must match
/\.mp3($|\?)/iβ it must end in.mp3, optionally followed by a query string such as?v=2. - Duplicate URLs are silently de-duplicated; the existing entry is selected instead.
- The server hosting the file must send a permissive CORS header (see the warning below).
β¦).
Permanently via source
The 16 default tracks are generated from a single expression near the top of the<script> block:
trackList array is built directly from presetUrls on the next line:
trackList carries { url, isCustom, index }. The isCustom: false flag means the dropdown will label them using the trackPrefix translation key (see the tip below) rather than showing a URL fragment.
Finding CORS-friendly MP3 sources
Not all audio hosts permit cross-origin playback. These sources are known to work well:| Source | Notes |
|---|---|
| Newgrounds Audio Portal | Direct .mp3 links from audio.ngfiles.com include Access-Control-Allow-Origin: * by design. |
| Freesound.org | Preview links work when the file is served from their CDN with CORS headers enabled. Verify the direct download URL before embedding. |
| Self-hosted files | Any static file server configured with Access-Control-Allow-Origin: * works without restriction β ideal for full control over your playlist. |
Audio settings
All tracks β both preset and custom β are played through theplayTrack() function, which creates a standard HTML Audio object:
loop = trueβ every track repeats indefinitely until stopped.volume = 0.5β set to any value between0.0(silent) and1.0(full volume). Change the literal inplayTrack()to update the default for all tracks.
stopMusic() followed by playTrack(), so the new volume takes effect immediately for the incoming track.