We've talked a lot about samples, meaning individual values in a stream of audio. Now, we arrive at sampling, meaning recording audio, playing back of audio, and sample, which means a piece of audio. Sadly, the word sample has an ambiguous meaning in this context.
To be able to record and play something, we'll need to reference memory somehow. We have two options for this: RAM and hard disk. Playing from the hard disk and recording to it can be done using [sfplay~]
and [sfrecord~]
respectively. The [sfinfo~]
object can be used to get additional info about the audio file such as sample rate, length, and so on. Playing from the disk is particularly useful if we need to play very long files since they would of course eat up our RAM. The same is true for recording. The big caveat here is that we don't have as much flexibility when playing from the disk, which is also the reason why we won't cover this technique any further.
Instead, let's take a look at a setup...