%% Apply Pitch-Shifting to Time-Domain Audio
% Read in an audio file and listen to it.

[audioIn,fs] = audioread('Counting-16-44p1-mono-15secs.wav');
sound(audioIn,fs)

%
% Increase the pitch by 3 semitones and listen to the result.

nsemitones = 3;
audioOut = shiftPitch(audioIn,nsemitones);
sound(audioOut,fs)

% Decrease the pitch of the original audio by 3 semitones and listen to the result.

nsemitones = -3;
audioOut = shiftPitch(audioIn,nsemitones);
sound(audioOut,fs)

% Copyright 2019 The MathWorks, Inc.