Ancient Brain
  
Drag the background!
 

Step 11. Add music

Now we add some background music. Insert the following code right at the top:
 const MUSICFILE = '/uploads/starter/SuspenseStrings.mp3';
 AB.backgroundMusic ( MUSICFILE );


Note on music autoplay: On some browsers, audio will not play automatically, but only in response to user interaction. So the code gives the user play and pause buttons. See notes on Audio autoplay on web pages,


Use your own music

  1. Get a downloadable file of some music you like.
  2. One site with free music is freemp3cloud.com. There are many others.
  3. When you find music you like, download the music file to your computer.
  4. Then upload the music file to Ancient Brain.
  5. Edit the code to play your music file.
The background is a program, showing the JavaScript graphics used on this site.
The globes light up when you log in. Drag the background to move the camera.
Customise background:  
Font:

Website © Ancient Brain 2025.
Users retain ownership of user content.

Platforms      Stats      The name      Terms and conditions

Call for partners      Contact

Call for partners!
Ancient Brain is looking for a partner to co-write a JavaScript coding book for schools, to be used worldwide. This would be a course for students in learning to code from scratch. The book and course will be integrated into the Ancient Brain site. This is an opportunity for someone looking to develop a course and textbook to partner with a site to promote it. Read more.