public bool isUseful() { // musicTimeOnSite = 1; // return true; // tools.log.Debug(RU); if (fileName.IndexOf(".wav") < 0) { return(false); } string RU = getProperty.getLeavePath() + "\\" + fileName; tools.log.Debug("leaveid:" + id + " 路径:" + RU); if (!new FileInfo(RU).Exists) { return(false); } cwf = new CheckWavFile(); bool isUseFul = cwf.isUseful(RU); musicTimeOnSite = cwf.getMusicTime(); // tools.log.Debug("秒"+musicTimeOnSite); if (!isUseFul) { return(isUseFul); } // tools.log.Debug("秒---"+musicTimeOnSite); return(isUseFul); }
public bool isUseful() { // return true; if (recordUrl.IndexOf(".wav") < 0) { return(false); } // tools.log.Debug("id" + id + " 路径1" + recordUrl); // tools.log.Debug("id" + recordUrl.Length + " 索引1: " + recordUrl.LastIndexOf("ecord")); string RU = recordUrl.Substring(recordUrl.LastIndexOf("ecord") + 5); //record // string RU = recordUrl.Substring(recordUrl.LastIndexOf("ecord") +8); //recordwav RU = getProperty.getRecordPath() + RU; tools.log.Debug("recordid:" + id + " 路径:" + RU); if (!new FileInfo(RU).Exists) { return(false); } cwf = new CheckWavFile(); bool temp = cwf.isUseful(RU); musicTimeOnSite = (int)cwf.wi.Second; return(temp); }
public void test() { // musicTimeOnSite = 1; // return true; // tools.log.Debug(RU); string RU = getProperty.getLeavePath(); tools.log.Debug("路径" + RU); // tools.log.Debug(RU); foreach (FileInfo fi in new DirectoryInfo(RU).GetFiles()) { cwf = new CheckWavFile(); cwf.isUseful(fi.FullName); musicTimeOnSite = cwf.getMusicTime(); // tools.log.Debug("秒" + musicTimeOnSite); } }