Playing sound: Switching seamlessly between two or more sounds
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I want to be able to switch quickly between playing two or more sounds. The purpose is to be able to compare two sounds against each other. It should be possible to select a part of the sound and loop this while switching between sound A and B as shown in the below figure.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/157972/image.png)
When switching from sound A to B (by pressing the B button), sound B should start playing at the current sample - and sound A should stop.
I have been looking at the audioplayer object but this does not support setting the start/stop at specific samples. Any suggestion on how this can be implemented in Matlab?
Thanks,
Jesper Boldt
0 comentarios
Respuestas (1)
Iain
el 5 de Mzo. de 2014
I don't know about seamlessly from a GUI.
You can play any duration of sound using "sound". I would be tempted to split the sound into, say, 0.1 second sections, and after playing each 0.1 section, determine what, if any, buttons have been pressed, and continue on with playing the appropriate sound.
If you can define when the switches happen, you can simply construct a sound vector by the normal means, and play it with "sound" or "soundsc"
2 comentarios
Rafael Kübler
el 18 de Jul. de 2019
Hi,
I'm facing the same problem.
Has there been any other solution since then?
Thanks.
Ver también
Categorías
Más información sobre Audio and Video Data en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!