Home > melodyRecognition > goSongDbRead.m

goSongDbRead

PURPOSE ^

讀取卡拉迷的 db 及 txt 檔案

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 讀取卡拉迷的 db 及 txt 檔案

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % 讀取卡拉迷的 db 及 txt 檔案
0002 
0003 txtFile='C:\Program Files\Karami4\plugin\SingingSearch\demo.txt';
0004 dbFile='C:\Program Files\Karami4\plugin\SingingSearch\demo.db';
0005 
0006 fprintf('Reading "%s" and "%s" ...\n', txtFile, dbFile);
0007 songData=songDbRead(txtFile, dbFile, 1);
0008 songNum=length(songData);
0009 fprintf('Finished reading %d songs\n', songNum);
0010 
0011 songName='高山青';
0012 index=-1;
0013 for i=1:songNum
0014     if strcmp(songData(i).songName, songName)
0015         index=i;
0016         break;
0017     end
0018 end
0019 
0020 if index>0
0021     n=40;
0022     fprintf('播放 "%s" 的前 %d 個音符...\n', songName, n/2);
0023     playmidi(songData(index).track(1:n));
0024 end

Generated on Tue 01-Jun-2010 09:49:37 by m2html © 2003