Table of Contents > Understanding Sound in JES > Sound Objects in JES
Sound Objects in JES

To understand how to work with sound in JES, you must first understand the objects (or encodings) that represent sounds.

You can imagine that each sound is made up of a collection of samples, which is made up of sample 0, sample 1, sample 2, etc.
Sounds
Sounds are encodings of sounds, typically coming from a WAV file.
Samples

Samples are collections of Sample objects, each indexed by a number, e.g. sample #0, sample #1, etc. samples[0] is the first Sample object, samples[1] is the second, etc. You can manipulate each Sample in the Samples like this:

for s in samples:
Sample
A sample is a value between -32768 and 32767 representing the voltage that a microphone would generate at a given instant when recording a sound. The length of the instant is typically either 1/44100 of a second
(for CD-quality sound) or 1/22050 of a second (for good enough sound on most computers). A Sample object remembers what sound it came from, so if you change its value, it knows to go back and change the right sample in the sound.
jump to top