### 28.2.7 Preparing digital sound data

The soundsec command prepares sound data in the form of a vector.

- soundsec takes one mandatory argument and one optional argument:
  - d, a real number (the duration).
  - Optionally, f, a real number (the sampling frequency, by default 44100).
- soundsec(d⟨,f⟩) returns sound data with duration d seconds, and with sampling frequency f, as a vector whose ith element is the time corresponding to index i.

#### Examples

soundsec(2.5)

Output: Sound data 2.5 seconds long sampled at the default frequency of 44100 Hz.

soundsec(1,22050)

Output: Sound data 1 second long sampled at the frequency of 22050 Hz.

sin(2*pi*440*soundsec(1.3))

Output: A sinusoidal signal with frequency 440 Hz sampled 44100 times per second for 1.3 seconds.