INSTRUCTIONS ON THE USE AND MODIFICATION OF THE SOUND DEFINITION FILE

The sound definition file, Sounds.list.json, is located in the same directory as this file.
The file is in a JSON-format and there is a specific syntax involved which you can validate
by going to http://www.jsonlint.com and pasting the contents of Sounds.list.json there. If
there is an error, the validator will point out the errorneous line. Make sure the file passes
the validation before running it in the game. No sound will be loaded if the file is not valid.

Also note that all sounds loaded in the game must be uncompressed PCM (.wav) and in 16-bit mono 
at 22 kHz.


EXAMPLE 1

The simplest valid file that loads one sound looks as follows:

---Sounds.list.json---
{
	"sound name":
	{
		"files":
		{
			"filenames":[ "MyFilename01.wav" ]
		}
	}
}
---Sounds.list.json---

"sound name" is the name by which the sound is referred to in game code. MyFilename01.wav is the name of your sound file on disk.


EXAMPLE 2

To define multiple sounds, you simply make several of these structures and separate them by a comma.

---Sounds.list.json---
{
	"sound name":
	{
		"files":
		{
			"filenames":[ "MyFilename01.wav" ]
		}
	},
	
	"another sound name":
	{
		"files":
		{
			"filenames":[ "AnotherFilename01.wav" ]
		}
	}
}
---Sounds.list.json---

Notice that the very last sound definition never has a comma at the end.


EXAMPLE 3

If you want to randomly pick one out of multiple files and have the game load that in memory, you can do as follows:

---Sounds.list.json---
{
	"sound name":
	{
		"files":
		{
			"filenames":[ "MyFilename01.wav", "MyFilename02.wav", "MyFilename03.wav" ]
		}
	}
}
---Sounds.list.json---

This will randomly associate "sound name" with one of the three filenames. There is no limit to how many filenames you can specify there.


EXAMPLE 4

Sometimes you want to load multiple files in memory and associate all of those your sound.

---Sounds.list.json---
{
	"sound name":
	{
		"files":
		{
			"filenames":[ "MyFilename01.wav" ],
			"filenames":[ "YourFilename01.wav" ],
			"filenames":[ "HerFilename01.wav" ]
		}
	}
}
---Sounds.list.json---

This will load all three files in memory and randomly pick one of them each time the game wants to play "sound name".


EXAMPLE 5

You can also combine the two approaches like so:

---Sounds.list.json---
{
	"sound name":
	{
		"files":
		{
			"filenames":[ "MyFilename01.wav", "MyFilename02.wav", "MyFilename03.wav" ],
			"filenames":[ "YourFilename01.wav" ],
			"filenames":[ "HerFilename01.wav", "HerFilename02.wav" ]
		}
	}
}
---Sounds.list.json---

This will load one of three MyFilename.wav's, YourFilename01.wav and one of two HerFilename.wav's in memory. It might, for example,
load MyFilename03.wav, YourFilename01.wav and HerFilename01.wav. Then, each time the game wants to play "sound name", it will randomly 
pick either MyFilename03.wav, YourFilename01.wav or HerFilename01.wav.


EXAMPLE 6

To limit the number of files chosen in memory, you can use "select".

---Sounds.list.json---
{
	"sound name":
	{
		"select":2,
		"files":
		{
			"filenames":[ "MyFilename01.wav" ],
			"filenames":[ "YourFilename01.wav" ],
			"filenames":[ "HerFilename01.wav" ]
		}
	}
}
---Sounds.list.json---

This will randomly select two of the three alternatives.


EXAMPLE 7

You can use "select" in combination with multiple choices, too.

---Sounds.list.json---
{
	"sound name":
	{
		"select":2,
		"files":
		{
			"filenames":[ "MyFilename01.wav", "MyFilename02.wav", "MyFilename03.wav" ],
			"filenames":[ "YourFilename01.wav" ],
			"filenames":[ "HerFilename01.wav", "HerFilename02.wav" ]
		}
	}
}
---Sounds.list.json---

This might, for example, load MyFilename03.wav and HerFilename01.wav in memory, and pick either of those for playing when game asks for
the sound.


EXAMPLE 8

You can control the frequency at which sounds are allowed to be played using "interval".

---Sounds.list.json---
{
	"sound name":
	{
		"interval":[ 2.0 ],
		"files":
		{
			"filenames":[ "MyFilename01.wav" ]
		}
	}
}
---Sounds.list.json---

This makes the game always wait 2 seconds before it can play the sound again.


EXAMPLE 9

You can also randomize the interval.

---Sounds.list.json---
{
	"sound name":
	{
		"interval":[ 2.0, 10.0 ],
		"files":
		{
			"filenames":[ "MyFilename01.wav" ]
		}
	}
}
---Sounds.list.json---

This makes the game wait between 2 and 10 seconds before it can play the sound again.


EXAMPLE 10

By using a special keyword "sound length", you can wait just enough for the sound finish playing.

---Sounds.list.json---
{
	"sound name":
	{
		"interval":[ "sound length" ],
		"files":
		{
			"filenames":[ "MyFilename01.wav" ]
		}
	}
}
---Sounds.list.json---


EXAMPLE 11

It also works when randomizing the interval.

---Sounds.list.json---
{
	"sound name":
	{
		"interval":[ "sound length", 15.0 ],
		"files":
		{
			"filenames":[ "MyFilename01.wav" ]
		}
	}
}
---Sounds.list.json---

This waits between the length of the sound and 15 seconds before allowing the sound to be played 
back again.
