void RenderTill(Stamp stamp) { const uint_t samples = Clock.SamplesTill(stamp); Sound::ChunkBuilder builder; builder.Reserve(samples); Renderers.Render(stamp, samples, builder); Target->ApplyData(builder.CaptureResult()); Target->Flush(); }
bool RenderFrame() override { try { ApplyParameters(); Sound::ChunkBuilder builder; builder.Reserve(SamplesPerFrame); Tune->Render(SamplesPerFrame, builder); Resampler->ApplyData(builder.CaptureResult()); Iterator->NextFrame(Looped); return Iterator->IsValid(); } catch (const std::exception&) { return false; } }
bool RenderFrame() override { static_assert(Sound::Sample::BITS == 16, "Incompatible sound bits count"); try { ApplyParameters(); Sound::ChunkBuilder builder; builder.Reserve(SamplesPerFrame); Engine->play(safe_ptr_cast<short*>(builder.Allocate(SamplesPerFrame)), SamplesPerFrame * Sound::Sample::CHANNELS); Target->ApplyData(builder.CaptureResult()); Iterator->NextFrame(Looped); return Iterator->IsValid(); } catch (const std::exception&) { return false; } }