フィルターのクリア

Creating a music player with matlab

3 ビュー (過去 30 日間)
Shubham Nishad
Shubham Nishad 2014 年 1 月 29 日
コメント済み: Walter Roberson 2014 年 1 月 30 日
Hi, I am creating a music player in matlab. One way to play sound is to read the wav file as
[record,fs] = wavread('filename');
sound(record,fs);
But that approch is not very effective because it allocates a lot of memory to variable record
I have another idea in my mind. I'll read a small number of samples
[record,fs] = wavread('filename',[n1,n2]);
sound(record,fs);
and then I read next set of samples and play them and this process will go on till the end of file. But I am not able to come up with some algorithm to accomplish it.
I have however figured out how to compute number of samples in a file.
siz = wavread('filename','size');
I tried this step
i = 1;
n1 = 1;
n2 = 100;
siz = wavread('filename','size');
siz1 = siz(1,1);
while(i < siz1)
[record,fs] = wavread('filename',[n1,n2]);
sound(record,fs);
n1 = n1+100;
n2 = n2+100;
i = i+100;
end
but it's not working. Please help me figure out the correct procedure to implement by idea.

回答 (1 件)

Honglei Chen
Honglei Chen 2014 年 1 月 29 日
編集済み: Honglei Chen 2014 年 1 月 29 日
  1 件のコメント
Walter Roberson
Walter Roberson 2014 年 1 月 30 日
audioplayer does not offer any obvious way to queue additional samples as you go. The DSP functions do appear to offer that possibility.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by