A package for importing and exporting AIFF and WAVE files in ALab. To
write the values of a container the usual code has to be changed the
following way:
// container.write(rate, bit, format, output);
// is replaced by
AIFF.write(container, rate, bit, output);
To read values from a soundfile the usual code has to be changed this
way:
// samp = new ASample(ch, file, bit, format, start, length);
// is replaced by
samp = AIFF.getInput(file);
// params of samp are set this way:
// ch, bit are read from file header
// format is big endian in AIFF format
// start is set to zero
// length is set to amount of samples in file
To get an ASampleLoop
using the values of a soundfile
the usual code has to be changed this way:
// samp = new ASample(ch, file, bit, format, start, length);
// loop = new ASampleLoop(samp, freq, phase, loopStart, loopLength);
// is replaced by
loop = AIFF.getWave(file);
// params of loop are set this way:
// samp is created with getInput(file)
// freq is set to original speed (samplerate / amount of samples)
// phase is set to zero
// start is set to zero
// length is set to amount of samples in file