How do I decrease sound exponentially when a user press button stop on my player app ?
Mostrar comentarios más antiguos
% code
afr = dsp.AudioFileReader('track1.wav');
adw = audioDeviceWriter('SampleRate', afr.SampleRate)
app.dec =1;
while ~isDone(afr)
audioIn = afr();
audioout = audioIn * app.dec;
adw(audioout);
end
with for the stopbutton
% code
t = 0:1/441000:4;
alpha = 0.1;
app.dec = exp(- alpha *t);
Basically I just want to avoid the brutal stop (which give me bad harmonics) by decreasing the sound smoothly with an exponential when we press the button stop.
Thank you !
1 comentario
Jan
el 4 de Oct. de 2017
Do you want to load a WAV file, fade out the sound in the last 4 seconds and save the file? Did you draw the curve?
t = 0:1/441000:4;
alpha = 0.1;
dec = exp(- alpha *t);
plot(t, dec)
Are you sure that this is the wanted amplification?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Audio Processing Algorithm Design en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!