diff options
| author | XANTRONIX Development | 2022-02-28 15:52:59 -0500 | 
|---|---|---|
| committer | XANTRONIX Development | 2022-02-28 15:52:59 -0500 | 
| commit | eb37f82dee0722a8295c42b1c11908ff67db45c2 (patch) | |
| tree | 3dd7fa5809b2dc5d8bb893b266044cd561a49ec9 /src | |
| parent | dce70ad2853d45489c3fdb0c1dd90cb0fbb58f4d (diff) | |
| download | xas-eb37f82dee0722a8295c42b1c11908ff67db45c2.tar.gz xas-eb37f82dee0722a8295c42b1c11908ff67db45c2.tar.bz2 xas-eb37f82dee0722a8295c42b1c11908ff67db45c2.zip | |
Fix bugs applying gain to voice output
Diffstat (limited to 'src')
| -rw-r--r-- | src/vox.c | 10 | 
1 files changed, 6 insertions, 4 deletions
| @@ -213,16 +213,18 @@ static ssize_t vox_fill(xas_vox *vox,      if (readlen == 0) {          vox_stop(vox); -    } else if (vox->gain != 1.0f) { +    } + +    readcount = readlen / vox->format.sample_size; + +    if (readcount > 0 && vox->gain != 1.0f) {          xas_audio_apply_gain(vox->format,                                 samples,                                 vox->gain,                                 0, -                               readlen); +                               readcount);      } -    readcount = readlen / vox->format.sample_size; -      xas_audio_zero(vox->format, samples, readcount, count-readcount);      return count; | 
 
    