Info
This question is closed. Reopen it to edit or answer.
how to loop it that if same continuos signal is coming like left and vice versa then it playes only once.
1 view (last 30 days)
Show older comments
switch (e)
case 5
[a fs]=wavread('tl.wav');
playerl=audioplayer(a,fs);
play(playerl),disp('left'),fprintf(ser,'L');
case 6
[a fs]=wavread('tl.wav');
playerl=audioplayer(a,fs);
play(playerl),disp('left'),fprintf(ser,'L');
case 7
[a fs]=wavread('tl.wav');
playerl=audioplayer(a,fs);
play(playerl),disp('left'),fprintf(ser,'L');
case 9
[b fs]=wavread('tr.wav');
playerr=audioplayer(b,fs);
play(playerr),disp('right'),fprintf(ser,'R');
case 10
[b fs]=wavread('tr.wav');
playerr=audioplayer(b,fs);
play(playerr),disp('right'),fprintf(ser,'R');
case 11
[b fs]=wavread('tr.wav');
playerr=audioplayer(b,fs);
play(playerr),disp('right'),fprintf(ser,'R');
case 13
[c fs]=wavread('mf.wav');
playerf=audioplayer(c,fs);
play(playerf),disp('forward'),fprintf(ser,'F');
case 14
[d fs]=wavread('mb.wav');
playerb=audioplayer(d,fs);
play(playerb),disp('back'),fprintf(ser,'B');
case 15
[c fs]=wavread('mf.wav');
playerf=audioplayer(c,fs);
play(playerf),disp('forward'),fprintf(ser,'F');
otherwise
[e fs]=wavread('s.wav');
players=audioplayer(e,fs);
play(players),disp('stop'),fprintf(ser,'S');
end
1 Comment
Geoff Hayes
on 22 Oct 2014
Please format the above code so that it is readable. Highlight the code and press the {} Code button.
Also, please describe in more detail what problem you are facing as it isn't that clear from your question. Clarify what you mean by how to loop it that if same continuos signal is coming like left and vice versa then it playes only once.
Answers (0)
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!