play audio song in background of my project

11 visualizaciones (últimos 30 días)
reema
reema el 14 de Ag. de 2014
Comentada: reema el 16 de Ag. de 2014
i want to play the audio tone(song), when my project GUI run ,,i have 3 GUI of my project which are linked with each other ,,...i want tooo play tone in background until my project is run.. can any on ehelp meee how can i play:
  2 comentarios
Joakim Magnusson
Joakim Magnusson el 14 de Ag. de 2014
What format is the sound file?
reema
reema el 14 de Ag. de 2014
sound in mp3 or format or wav form

Iniciar sesión para comentar.

Respuesta aceptada

Joakim Magnusson
Joakim Magnusson el 14 de Ag. de 2014
Editada: Joakim Magnusson el 14 de Ag. de 2014
If you have a .wav file i think this will work. First load your file:
[y f]=audioread('yourMusicFile.wav');
Then play audio with:
sound(pl);
Stop sound with:
clear playsnd;
  28 comentarios
reema
reema el 16 de Ag. de 2014
and when me use this code also your recommended:
persient player;
[y f]=audioread('21.mp3');
player = audioplayer(y,f);
play(player);
then error show:
Undefined function 'persient' for input arguments of type 'char'.
Error in Face_Detection_And_Recognition>Face_Detection_And_Recognition_OutputFcn (line 96)
persient player;
reema
reema el 16 de Ag. de 2014
sir do you have any idea about voice effects in matlab? i want to generate voice with effect...i have simple recorded voice and want to hear in voice efects(sound effects)..

Iniciar sesión para comentar.

Más respuestas (1)

Sean de Wolski
Sean de Wolski el 14 de Ag. de 2014
audioplayer can play without play blocking (so your other processes and continue).
  3 comentarios
Sean de Wolski
Sean de Wolski el 14 de Ag. de 2014
When you play a song with sound, it blocks audioplayer does not so you can have your code running.
Read the example in the doc linked or at:
doc audioplayer
reema
reema el 14 de Ag. de 2014
but when me use the audioplayer then i can;t hear the song

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by