What Windows XP teach us about startup sound effect
Tags: ux, webdesktop, webdev
Published: 2021-08-16 04:47:45

{% youtube nXbvOAsRww8 %}

(Play it with sound!!!)

## Background Story
I have been working on an open source web desktop system called [ArozOS](https://github.com/tobychui/arozos) for 3+ years now. In simple words, it is a web desktop system that actually do works like a real OS. 

{% github tobychui/arozos %}

## User Customization Features
I guess this is kind of a common issue regarding open source software, which is, they offer little to no customization of user interface to their users. In ArozOS, as I am developing it as a daily driver for those has multiple devices like me, I need a way to customize my own system without the need for messing around with the source code. This features will also benefit those who has no programming background and use ArozOS as a part of their daily routine. That is why I had added Wallpaper and Theme color customization to the system since last year.

![2021-08-16_12-11-14](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/un283hhwqrhgwdlhzhwp.png)

So here comes a question: Should we allow user to customize their web desktop startup sound?
 
## Why Startup Sound?
Since Windows 10, Microsoft has removed their startup sound from their OS. As quoted from [here](https://ux.stackexchange.com/questions/104893/what-is-the-significance-of-the-start-up-sound-of-a-system)
> We removed the startup sound because startup is not an interesting event on a modern device.

In most case, it is true. No one want to startup their laptop in a library and being greeted with the amazing OS startup sound at full volume. However, this is a web desktop system, which means your devices has already turned on and the browser opened. Isn't that means it is safe for us to include this feature?

### Startup sound in the Windows XP era
In the era of Windows XP, everyone is amazed by the new technology and the startup sound bring joy to everyone using the OS. Compare to the modern OSes, OSes now are boring and feels the same. In ArozOS, I want to change this. At least at the user option to opt-in the joyfulness and surprise of launching their web desktop system. After some discussion with the co-author, we decided to add this feature into the next release.

### Implementation of startup sound on web desktop
From the technical perspective, there is nothing difficult to implement this feature. It is as simple as a AJAX function call to the database endpoint to get which music file to play when the web desktop startup.
```
$.ajax({
	url: "../../system/desktop/preference",
	method: "GET",
	data: {preference: "startup-audio"},
	success: function(data){
		if (data == undefined || data == ""){
			return;
		}
		var currentGlobalVol = localStorage.getItem("global_volume");
		if (currentGlobalVol != null && currentGlobalVol != undefined && currentGlobalVol != ""){
			
		}else{
			currentGlobalVol = 0;
		}

		var audio = new Audio("media?file=" + data);
		audio.volume = currentGlobalVol;
		audio.play();
	}
});
```

and some basic HTML for setting up the config interface like so
![2021-08-15_23-34-00](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l39q42t90o7s05w5idtq.png)
 

### Result
The result is as the first video attached at the top of this post. By changing the desktop background to a Windows XP wallpaper and updating the theme color settings, it looks like a modern version of the original windows XP 

![2021-08-16_11-33-04](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ht1020knpl4myoozg5xh.png)
  
If you are an open source developer like me, try to think of something to bring joy to the users. A hidden Easter egg in a suitable location will always bring smile to everyone :D