How to get a feature from sound/audio data learning using machine learning supervised classification?
Your pipeline is roughly right, but clarifying it a bit below:

1. Load the audio
2. Convert the audio to a `spectrogram` using STFT
3. Apply mel-scale filtering to get `mel-spectrogram`
4. Transform using DCT to get `MFCC`


You now have a time sequence of MFCC frames. It is typical for the classifier to operate on a time window of such frames. The window length can be relatively small (say 4-10 frames), or be the entire length of an audio clip. If they are smaller, the windows are often processed with some overlap.

Learning and outputting predictions for the entire file is the easiest, a standard classification problem.

If labels are only available on the entire file ("weak labeling") but one wants to output a prediction per window, this is usually done with Multi-Instance Learning.