Пример #1
0
 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();
 }
Пример #2
0
    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;
      }
    }
Пример #3
0
    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;
      }
    }