From 95eb6fb575b04270ef69a124d3bcd839aaf4f6e5 Mon Sep 17 00:00:00 2001 From: Will Angenent Date: Mon, 14 May 2018 22:44:44 +0100 Subject: [PATCH] Shortened audio attenuation --- audio/audio.go | 4 ++-- system/system.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/audio/audio.go b/audio/audio.go index b7e1dcd..aa3c9a9 100644 --- a/audio/audio.go +++ b/audio/audio.go @@ -82,11 +82,11 @@ func Init() { func Click() { ForwardToFrameCycle() - system.AudioAttenuationCounter = 4000 + system.AudioAttenuationCounter = 400 system.LastAudioValue = ^system.LastAudioValue } -func attenuate(sample uint16) uint16 { +func attenuate(sample int16) int16 { if system.AudioAttenuationCounter == 0 { return 0 } else { diff --git a/system/system.go b/system/system.go index dc7954a..658eddc 100644 --- a/system/system.go +++ b/system/system.go @@ -14,15 +14,15 @@ var ( Cycles uint64 FrameCycles uint64 AudioCycles uint64 - AudioChannel chan uint16 + AudioChannel chan int16 + LastAudioValue int16 LastAudioCycles uint64 - LastAudioValue uint16 AudioAttenuationCounter uint64 ) func Init() { Cycles = 0 - AudioChannel = make(chan uint16, AudioSampleRate*4) // 1 second + AudioChannel = make(chan int16, AudioSampleRate*4) // 1 second LastAudioValue = 0x2000 }