From d4873545b2c22d3822453023b66172099d0f5a39 Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Sat, 24 Aug 2019 10:46:32 -0400 Subject: [PATCH] audio: remove dc bias --- src/audio.ts | 7 ++++--- src/machine/vicdual.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/audio.ts b/src/audio.ts index 9a48b2df..75eacf84 100644 --- a/src/audio.ts +++ b/src/audio.ts @@ -395,10 +395,11 @@ export var SampleAudio = function(clockfreq) { self.sr=self.context.sampleRate; self.bufferlen=2048; - // Amiga 500 fixed filter at 6kHz. WebAudio lowpass is 12dB/oct, whereas - // older Amigas had a 6dB/oct filter at 4900Hz. + // remove DC bias self.filterNode=self.context.createBiquadFilter(); - self.filterNode.frequency.value=6000; + self.filterNode.type='lowshelf'; + self.filterNode.frequency.value=100; + self.filterNode.gain.value=-6; // mixer if ( typeof self.context.createScriptProcessor === 'function') { diff --git a/src/machine/vicdual.ts b/src/machine/vicdual.ts index 184860a0..391ab0da 100644 --- a/src/machine/vicdual.ts +++ b/src/machine/vicdual.ts @@ -27,7 +27,7 @@ const vsyncFrequency = hsyncFrequency / 0x148; const cpuCyclesPerLine = cpuFrequency / hsyncFrequency; const timerFrequency = 500; // input 2 bit 0x8 const cyclesPerTimerTick = cpuFrequency / (2 * timerFrequency); -const audioOversample = 4; +const audioOversample = 2; const audioSampleRate = 60 * scanlinesPerFrame; // why not hsync? export class VicDual extends BasicScanlineMachine {