How can I generated an audio sequence from segmentes of an audio sample?
Show older comments
Hi. Please help me!
I need generated a sequence of audio from segments of an segmented sample audio. This sequence has not a limit of time. The duration of the sequence is determinated from the user.
I have a sample of 10 seconds, that was segmented in sub samples. This sub clips has to be reproduce in a sequence of undeterminated duration.
clear all clc close all
%load sample sample = miraudio('lluvia.wav');
%Descompose the sample in frames frames = mirframe(muestra, 0.032);
%Spectral Analysis spectrum = mirspectrum(frames);
%Analysis of timbre for each frame mfcc = mirmfcc(spectrum);
%Similarity of each frame disimilitud = mirsimatrix(mfcc, 'Dissimilarity'); similitud = mirsimatrix(disimilitud, 'Similarity', 'oneminus'); %Novelty curve of similarity novedad = mirnovelty(similitud); %Select peaks picos = mirpeaks(novedad); %segment sample segmentos = mirsegment('lluvia.wav',picos); %get data from mirobject t = get(segmentos,'Data'); D = t{:}; %store each segment in a variable s1 = D{1:1}; s2 = D{2:2}; s3 = D{3:3}; s4 = D{4:4}; s5 = D{5:5}; s6 = D{6:6}; s7 = D{7:7}; s8 = D{8:8}; vector = [s1; s2; s3; s4; s5; s6; s7; s8;];
2 Comments
Puneet Rana
on 1 Jun 2017
Can you explain more about what you want to do in reference to the code that you have posted? Looks like you get a vector of samples in 'vector', but what do you want instead?
Jan
on 2 Jun 2017
If you use the "{} Code" button to format your code, we could read it.
Answers (1)
Jan
on 2 Jun 2017
Do not create a bunch of variables with an index hidden in the name. Using indices as indices is much easier and better.
t = get(segmentos,'Data');
A "sequence of undeterminated duration" is not possible - how could a deterministric programming language create something undeterminated? Perhaps you want:
Result = cat(1, t{randi([1, length(t), 100)})
Now you get a concatenated vector of 100 random parts. If you want something else, explain this.
Categories
Find more on Code Generation and Deployment in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!