# Preparing digital sound data: soundsec

### 15.1.14 Preparing digital sound data: soundsec

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. The sound data is returned as a vector, whose ith element is the time corresponding to index i.

#### Examples.

- Input:
  soundsec(2.5)
  Output:
  Sound data 2.5 seconds long sampled at the default frequency of 44100 Hz.
- Input:
  soundsec(1,22050)
  Output: Sound data 1 second long sampled at the frequency of 22050 Hz.
- Input:
  sin(2*pi*440*soundsec(1.3))
  Output: A sinusoid with frequency 440 Hz sampled 44100 times per second for 1.3 seconds.