INNER CODE UNIT · C

_a_get_gain

tek256/astera · src/audio.c:309

static float _a_get_gain(a_ctx* ctx, uint32_t id, uint8_t is_sfx) {
  float gain  = 0.f;
  float lgain = _a_get_layered_gain(ctx, id, is_sfx);

  if (is_sfx) {
    a_sfx* sfx = &ctx->sfx[id - 1];
    if (sfx->req) {
      gain = sfx->req->gain;
    } else {
      return -1.f;
    }
  } else {
    a_song* song = &ctx->songs[id - 1];
    if (song->req) {
      gain = song->req->gain;
    } else {
      return -1.f;
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…