Borrar filtros
Borrar filtros

how to make audio sound like continuous between each loop

1 visualización (últimos 30 días)
Roger
Roger el 22 de Abr. de 2015
Comentada: Roger el 22 de Abr. de 2015
in each loop i use sound(sig) , the length of sig is about o.5s, if i use pause in each loop, it may sound discontinuous ,if not pause , i think the sound may overlap, how to make it sound continuous and each sig completely played?

Respuestas (1)

Image Analyst
Image Analyst el 22 de Abr. de 2015
Have a ramp for weights then replace the beginning and end of the signal with a weighted sum. So at the end of the signal, you have like the originalSignalAtEnd .* ramp + originalSignalAtBeginning .* (1-ramp). Then to the same to weight the beginning of the signal. I've left out the details so you can feel some pride and ownership of the code, but I think you can understand the concept. Let me know if you can't figure it out and I might help more tomorrow.
  6 comentarios
Image Analyst
Image Analyst el 22 de Abr. de 2015
It seems like it's playing the sound asynchronously. If you can get the sound file to play synchronously then it won't go on to the next line of code until the sound is done and you won't need a pause. Unfortunately I don't see an option for that in soundsc(). Maybe there's a way though, that I don't know.
You're correct about #2.
Roger
Roger el 22 de Abr. de 2015
Anyway ,thanks.

Iniciar sesión para comentar.

Categorías

Más información sobre Audio I/O and Waveform Generation 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