필터 지우기
필터 지우기

How can i use audioplayer function to play many wav files?

조회 수: 1 (최근 30일)
Firzi Mukhri
Firzi Mukhri 2013년 4월 15일
How can i use audioplayer function to play many wav files?
The current example show me how to play a wav file. how can i make this function play 22 wav files one by one?
%load c.mat file where 22 wav files is found in the workspace
load c;
%set player as audioplayer function that play '1'
player = audioplayer (1, fs);
%play sound named in player
play (player, [1 (get (player, 'SampleRate') *3)]);
I need to play 2,3,4,5... 22. That I have loaded in the workspace. Thank you.

채택된 답변

Walter Roberson
Walter Roberson 2013년 4월 15일
is the "1" here a file name? You cannot have a variable named "1" or "2" or so on. audioplayer(1, fs) asks to play the sound created by the single sample whose value is 1.0
audioplayer() is not able to play multiple files in itself. I also do not find any documented method of changing the sample data after the object is created. It appears that it might be necessary to delete the audioplayer object and create a new one with the new sample list.
  댓글 수: 3
Walter Roberson
Walter Roberson 2013년 4월 15일
Is it okay to play them with one continuing immediately after the other? If so then create a single matrix of samples by vertcat()'ing all of the data together.
Firzi Mukhri
Firzi Mukhri 2013년 4월 15일
thanks! the link you provided earlier solve it. :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by