이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
play audio song in background of my project
조회 수: 1 (최근 30일)
이전 댓글 표시
reema
2014년 8월 14일
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
채택된 답변
Joakim Magnusson
2014년 8월 14일
편집: Joakim Magnusson
2014년 8월 14일
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
reema
2014년 8월 14일
its work wwith his code ...but now tell me i want to stop this song in spacific palace (when me pushbutton click)..now how can i do this?
[y f]=audioread('21.mp3');
sound(y,f);
reema
2014년 8월 14일
orr can i repeat this song until project last GUI is open..when GUI is exit then song shold be stop
reema
2014년 8월 14일
can i repeat the song until my last GUI is open ..when last GUI is exit then song is stop...or pushing any button the song will stop
Joakim Magnusson
2014년 8월 14일
편집: Joakim Magnusson
2014년 8월 14일
Like Sean answered, try audioplayer:
player = audioplayer(y,f);
play(player);
pause(player);
resume(player);
stop(player);
reema
2014년 8월 14일
no its not work.... thsi code didin;t play the song even: my code is playthe song given below:
[y f]=audioread('21.mp3');
sound(y,f);
Joakim Magnusson
2014년 8월 14일
This doesn't work you say?:
[y f]=audioread('21.mp3');
player = audioplayer(y,f);
play(player);
Joakim Magnusson
2014년 8월 14일
i think the handle to the player disappear after the callback and therefore the audioplayer disappear. try:
persient player;
[y f]=audioread('21.mp3');
player = audioplayer(y,f);
play(player);
or this is just a guess but maybe just:
[y f]=audioread('21.mp3');
handles.player = audioplayer(y,f);
play(player);
reema
2014년 8월 14일
i got the ans ...if we stop the music then simplyy
clear sound;
its wok with my code not with audioplayer's code
reema
2014년 8월 14일
joakim sir i need some professional tones which me able to play in background of my project when its run ..can you help me? give any link for download professional tones
Joakim Magnusson
2014년 8월 14일
Doesn't this work with audioplayer? :
stop(player);
What do you mean with profesional tones ?
reema
2014년 8월 15일
i have a project i want to playback the tone when its run ...soo its a project so the tone should be anyy profeesional
reema
2014년 8월 15일
noo itss nott work with matlab R2013a ..i don't knw about other versions.. its nott workk when we apply this code :
[y, f]=audioread('21.mp3');
player = audioplayer(y,f);
play(player);
then we can't hear the song even...
reema
2014년 8월 15일
and when we use stop(player); the errror show
Undefined function or variable 'player'.
Error in Face_Detection_And_Recognition>pushbutton1_Callback (line 106)
stop(player);
Joakim Magnusson
2014년 8월 16일
Like i said , you must "save" the handle to the audioplayer. Either by this at the begining of your code:
persient player;
Or by this whey you create the audioplayer:
handle.player = audioplayer (Y, f);
reema
2014년 8월 16일
no sir, when me use this presient code then error show undefine function presient....its not work with matlab r2013a
Joakim Magnusson
2014년 8월 16일
편집: Joakim Magnusson
2014년 8월 16일
What happens when you use handle? Without using persient.
reema
2014년 8월 16일
when me use this code your recommended:
[y f]=audioread('21.mp3');
handles.player = audioplayer(y,f);
play(player);
then error show:
Undefined function or variable 'player'.
Error in Face_Detection_And_Recognition>Face_Detection_And_Recognition_OutputFcn (line 100)
play(player);
reema
2014년 8월 16일
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
2014년 8월 16일
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)..
추가 답변 (1개)
Sean de Wolski
2014년 8월 14일
audioplayer can play without play blocking (so your other processes and continue).
댓글 수: 3
Sean de Wolski
2014년 8월 14일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Audio and Video Data에 대해 자세히 알아보기
태그
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)