News for hackers. Stuff that matters.
Re:C++ audio mixing library design by pjmlp on Monday October 17, 2022 @02:35AM (#33230392)
No reason to use them on C++ method definitions.

    void engine::callback(std::span<float> output)
    {
        std::size_t samples = 0;
        if (stream_)
        {
            samples = stream_->read(output.data(), output.size());
            if (samples == 0) stream_ = nullptr;
        }
        auto remaining = output.subspan(samples);
        std::fill(remaining.begin(), remaining.end(), 0.f);
    }

There are no comments on this comment yet.