~gsthnz/mtrnm

5afab86394dd95eede27ca569faa571d0f70f083 — Gustavo Heinz 1 year, 1 month ago 42ea82a
Tune volume for beeps
1 files changed, 2 insertions(+), 1 deletions(-)

M wave.go
M wave.go => wave.go +2 -1
@@ 58,7 58,8 @@ func (s *sineWave) Read(buf []byte) (int, error) {
	p := s.pos / int64(num)
	for i := 0; i < len(buf)/num; i++ {
		const max = 32767
		waveNumber := math.Sin(2*math.Pi*float64(p)/length) * 0.3 * max
		const volume = 0.5
		waveNumber := math.Sin(2*math.Pi*float64(p)/length) * volume * max
		waveNumber *= delayStart
		delayStart *= decayFac
		b := int16(waveNumber)