I have a dataset of audio files, which differ on their lengths by a couple of milliseconds. Some are little shorter than 1s and some are little longer than 1s. They all have the same sampling rate, namely 20kHz, what differs is the number of samples.
Does anyone know a way to automatically transform them into 1s audio files with 20kHz sampling rate?
EDIT: I need to transform the audios to having the same length so that I can input them into a standard fully-connected neural network.
Cutting the audio in the beginning and at the end would be the best solution, I think, if the audio is longer than 1 second. For example, if the audio is longer 1.1s, then I would like to cut the audio by 5ms in the beginning and the end to transform it to a 1s audio? And if the data is shorter, somehow putting some "silence" at the end of the data?
Thank you in advance!