Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clock_t t1;
- while (audioPeriodCounter * 2 * pocetchannel < pocetoperaci * 5) // nvm proc je tu ta *2, chanely uz jednou pouzivam, idk proc tam je ta *2 a vubec jestli je to *2 nebo * channels
- {
- t1 = clock();
- //std::cout << audioPeriodCounter;
- ts3Functions.processCustomCaptureData("customWaveDeviceId", buffer + ((captureAudioOffset * pocetchannel) / 5), (freq / 5));
- //if (captureAudioOffset * pocetchannel / 10 + freq / 10 > maxread) //nvm jestli se podminka vzdy triggerne prvni idk, takto by to tam dole v tsfci nemelo cist dal
- //{
- //std::cout << "wtf" << captureAudioOffset * pocetchannel + freq << " asdasdasd " << maxread << std::endl;
- // std::this_thread::sleep_for(std::chrono::nanoseconds(10000000));
- // break;
- //}
- //std::cout << "FIXED";
- audioPeriodCounter++;
- captureAudioOffset = audioPeriodCounter*freq;
- auto volume = std::thread(lambda, freq, buffer, captureAudioOffset);
- volume.detach();
- //lambda(freq, buffer, captureAudioOffset);
- //std::cout << (float)t2-(float)t1 << std::endl;
- //(((double)clock()-t1)/CLOCKS_PER_SEC)
- std::unique_lock<std::mutex> lk(stopm);
- double hodnota = (((double)clock()-(double)t1)/CLOCKS_PER_SEC)*1000000000;
- int number = 200000000 - hodnota;
- if (stopcv.wait_for(lk, std::chrono::nanoseconds(number), [] {return stoprequest.load(); }) == true)
- {
- std::this_thread::sleep_for(std::chrono::nanoseconds(250000000));
- break;
- }
- //std::this_thread::sleep_for(std::chrono::nanoseconds(200000000));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement