Playing sound: Switching seamlessly between two or more sounds

2 次查看(过去 30 天)
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.
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

回答(1 个)

Iain
Iain 2014-3-5
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 个评论
Jesper Boldt
Jesper Boldt 2014-3-6
Yes, this might be workaround but it does not seem that - ehhm - elegant. I wonder if any 3rd party tools or code would support my problem, e.g. some java stuff which could be called from Matlab.
I am not able to define when the switching from one sound to the other happens. This is based on the user input.
What I want can be found in (m)any sound processing tool, e.g. audacity, audition, etc. Here you can solo a track a switch between the sound streams.
Thanks,
Jesper
Rafael Kübler
Rafael Kübler 2019-7-18
Hi,
I'm facing the same problem.
Has there been any other solution since then?
Thanks.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by