Generate array with a specified number of random songs from folder

2 visualizaciones (últimos 30 días)
Generate array with a specified number of random songs from folder

Respuesta aceptada

Jan
Jan el 8 de Mayo de 2022
piesele = {'1.mp3'; '2.mp3'; '3.mp3'; '4.mp3'; '5.mp3'; '6.mp3'; '7.mp3'; '8.mp3'; '9.mp3'; '10.mp3';...
'11.mp3'; '12.mp3'; '13.mp3'; '14.mp3'; '15.mp3'; '16.mp3'; '17.mp3'; '18.mp3'; '19.mp3'; '20.mp3'};
val = randperm(6);
This is a randomly ordered list of the first 6 names only. Better:
val = randperm(numel(piesele), 6);
The problem is inside this command:
[s(:, i), Fs] = audioread(piese{i}, [1, 100000]);
The sizes of s(:, i) and the output of audioread do not match. Check this:
size(s(:, i))
size(audioread(piese{i}, [1, 100000]))

Más respuestas (0)

Categorías

Más información sobre Historical Contests en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by