how to sample an audio file ?

18 vues (au cours des 30 derniers jours)
mohamed gamal
mohamed gamal le 4 Mai 2021
how to sample an audio file ?

Réponses (1)

Walter Roberson
Walter Roberson le 4 Mai 2021
[data, fs] = audioread('name_of_file_goes_here.wav');
num_seconds = 1; %does not need to be integer
sample_length = floor(fs * num_seconds);
sample_start = randi([1, size(data,1)-sample_length+1]);
sample = data(sample_start:sample_start+sample_length-1, :);

Catégories

En savoir plus sur Simulation, Tuning, and Visualization dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by