int main() { //set buffer size setOutputBufferSize(8); //enable DAC *audioDacEnReg = 1; // audio data for(int i=0; i<4; i++) { setOutputBuffer(audioArrayL[i], audioArrayR[i]); } printf("Done first\n"); printf("IWannaWaitVeryVeryLong\n"); // audio data for(int j=0; j<3; j++) { for(int i=0; i<4; i++) { setOutputBuffer(audioArrayL[i]+3, audioArrayR[i]+3); } } printf("done second\n"); return 0; }
size_t StripSpace::convert(const uint8_t* buf, size_t buflen) { auto buffer = make_unique<OBuffer>(); buffer->reserve(buflen); for (size_t i = 0; i < buflen; ++i) { uint8_t ch = buf[i]; if (!m_isWhitespace[ch]) { buffer->push_back(ch); } } setOutputBuffer(std::move(buffer)); return buflen; }
void SignerFilter::finalize() { size_t sigLen = 0; if (EVP_DigestSignFinal(m_impl->ctx, nullptr, &sigLen) != 1) NDN_THROW(Error(getIndex(), "Failed to estimate buffer length")); auto buffer = make_unique<OBuffer>(sigLen); if (EVP_DigestSignFinal(m_impl->ctx, buffer->data(), &sigLen) != 1) NDN_THROW(Error(getIndex(), "Failed to finalize signature")); buffer->erase(buffer->begin() + sigLen, buffer->end()); setOutputBuffer(std::move(buffer)); flushAllOutput(); }
void Base64Encode::fillOutputBuffer() { int nRead = BIO_pending(m_impl->m_sink); if (nRead <= 0) return; // there is something to read from BIO auto buffer = make_unique<OBuffer>(nRead); int rLen = BIO_read(m_impl->m_sink, buffer->data(), nRead); if (rLen < 0) return; if (rLen < nRead) buffer->erase(buffer->begin() + rLen, buffer->end()); setOutputBuffer(std::move(buffer)); }
int main() { short inL = 0; short inR = 0; //buffer sizes setInputBufferSize(8); setOutputBufferSize(8); //enables *audioAdcEnReg = 1; *audioDacEnReg = 1; for(int i=0; i<12; i++) { getInputBuffer(&inL, &inR); setOutputBuffer(inL, inR); } printf("done\n"); return 0; }
void reverbClass::init(int delaySamps, int* in, int* out) { setInputBuffer(in); setOutputBuffer(out); setReverbDelay(delaySamps); }