MCPcopy Create free account
hub / github.com/OpenEarable/open-earable / update_audio

Method update_audio

src/task_manager/TaskManager.cpp:102–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102int TaskManager::update_audio(Provider * provider, int max_buffers) {
103 if (max_buffers <= 0 || (*provider->stream)->ready() == 0) return 0;
104
105 int cont = provider->provide(max_buffers);
106
107 // Make sure that time limit is not reached
108 // Compute rest: rest 0 => good; rest == total blocks => bad and return
109 if (!cont || max_buffers == cont || check_overlap(provider)) return cont;
110 int cont2 = provider->provide(max_buffers - cont);
111 return cont + cont2;
112}
113
114void TaskManager::begin(float baro_samplerate, float imu_samplerate) {
115 if (baro_samplerate >= 0) _baro_delay = (int) baro_samplerate > 0 ? (1000.0/baro_samplerate) : _default_loop_delay;

Callers

nothing calls this directly

Calls 2

readyMethod · 0.45
provideMethod · 0.45

Tested by

no test coverage detected