sound_test.m 253 B

12345678910
  1. % Define parameters
  2. Fs = 8192; % Sampling frequency (Hz)
  3. t = 0:1/Fs:2; % 2 seconds duration
  4. f = 440; % Frequency of the tone (440 Hz)
  5. % Generate sine wave
  6. y = sin(2 * pi * f * t);
  7. % Play the generated tone
  8. sound(y, Fs)