public static void Save(string newName, WaveScanner ws, int overhead, bool createLogs) { List <splitter> chains = ARSplitter.GetChains(ws.NumFiles, overhead); int chain_n = 1; foreach (splitter chain in chains) { WavCollection samples = ws.GetSamples(chain); Wav total = samples.GetChain(); for (int k = 0; k < chain.fillers; k++) { total.CatSilence(samples.MaxDuration()); } int tot = chain.chainLen + chain.fillers; string wavName, logName; mkNames(newName, tot, chain_n, out wavName, out logName); total.Save(wavName); if (createLogs) { saveLog(logName, chain.fillers, samples); } chain_n++; } }
public Wav(Wav copy) { header = new wavHeader(copy.header); format = new wavFormat(copy.format); data = new wavData(copy.data); OrigDuration = copy.OrigDuration; FileName = copy.FileName; Name = copy.Name; }
public void Cat(Wav inputFile) { byte[] temp = createTempCopy(inputFile.data.samples.Length); for (int k = 0; k < inputFile.data.samples.Length; k++) { temp[k + samples.Length] = inputFile.data.samples[k]; } assignTempCopy(temp); }
public Wav GetChain() { roundUp(); Wav total = new Wav(); foreach (Wav wf in waveList) { total.Cat(wf); } return(total); }
public string GetLongestSample(out int dur) { Wav wf = maxPtr(); if (wf != null) { dur = wf.Duration; return(wf.Name); } dur = 0; return(null); }
public void Cat(Wav inputFile) { if (header == null) { header = new wavHeader(inputFile.header); format = new wavFormat(inputFile.format); data = new wavData(inputFile.data); } else { data.Cat(inputFile); } }
private Wav maxPtr() { Wav rv = null; int curDur = 0; foreach (Wav wf in waveList) { int dur = wf.OrigDuration; if (dur > curDur) { curDur = dur; rv = wf; } } return(rv); }