void S_LocalSound(char *s) { Wave *const wave = load_wave(s); if (wave == NULL) { return; } play_local_voice(wave); }
void wave_t::wavelet_analysis() { scale = ui->spinBox_scale->value(); freq_noise = ui->freq_noise->value(); /// The smallest scale to render. lowerScale = ui->value1->value();//20 /// The largest scale to render. upperScale = ui->value2->value();//50 for (int time = 0; time < voice_y.size(); time++) { double max_freq = freq_noise; int number_max_freq = -1; for (int freq = 0; freq < (upperScale - lowerScale)*scale; freq++) if (max_freq < local_colorMap->data()->cell(time, freq)) { max_freq = local_colorMap->data()->cell(time, freq); number_max_freq = freq; //qDebug() << "ANALYSIS MAX: time = " << time << "; max_freq = " << max_freq << ";number = "<< number_max_freq; } if (number_max_freq != -1) { //qDebug() << "ANALYSIS: time = " << time << "; max_freq = " << max_freq << ";number = "<< number_max_freq; int barrier = 0; for (int freq = number_max_freq; freq < (upperScale - lowerScale)*scale; freq++) if (local_colorMap->data()->cell(time, freq) < freq_noise) { barrier = 1; local_colorMap->data()->setCell(time, freq, 0); } else if (barrier){ local_colorMap->data()->setCell(time, freq, 0); } barrier = 0; for (int freq = number_max_freq; freq >= 0; freq--) if (local_colorMap->data()->cell(time, freq) < freq_noise) { barrier = 1; local_colorMap->data()->setCell(time, freq, 0); } else if (barrier){ local_colorMap->data()->setCell(time, freq, 0); } } else{ for (int freq = 0; freq < (upperScale - lowerScale)*scale; freq++) local_colorMap->data()->setCell(time, freq, 0); } ui->progress_wavelet->setValue(((100*time)/voice_y.size())); } load_wave(); }
void SpinAdapted::Wavefunction::LoadWavefunctionInfo (StateInfo &waveInfo, const std::vector<int>& sites, const int wave_num) { char file [5000]; sprintf (file, "%s%s%d%s%d%s%d%s%d%s", dmrginp.load_prefix().c_str(), "/wave-", sites [0], "-", *(sites.rbegin()), ".", mpigetrank(), ".", wave_num, ".tmp"); if (dmrginp.outputlevel() > 0) pout << "\t\t\t Loading Wavefunction " << file << endl; waveInfo.Allocate (); if (mpigetrank() == 0) { std::ifstream ifs(file, std::ios::binary); boost::archive::binary_iarchive load_wave(ifs); load_wave >> onedot >> waveInfo >> *waveInfo.leftStateInfo >> *(waveInfo.leftStateInfo->leftStateInfo) >> *(waveInfo.leftStateInfo->rightStateInfo) >> *waveInfo.rightStateInfo; if(!onedot) load_wave >> *(waveInfo.rightStateInfo->leftStateInfo) >> *(waveInfo.rightStateInfo->rightStateInfo); this->Load (ifs); ifs.close(); }
sfx_t *S_PrecacheSound(char *sample) { return reinterpret_cast<sfx_t *>(load_wave(sample)); }
void S_TouchSound(char *sample) { load_wave(sample); }