mirror of
https://github.com/kccleoc/seedpgp-web.git
synced 2026-03-07 09:57:50 +08:00
fix(audio): prime Safari mic graph; use raw PCM fallback; stabilize teardown
Route mic source through analyser into a silent sink to force processing on Safari/WebKit. Add ScriptProcessorNode raw-PCM capture path for reliable RMS/entropy sampling. Clamp/scale levels to avoid Infinity/opacity warnings and improve UI thresholds. Deduplicate/guard AudioContext shutdown to prevent “Cannot close a closed AudioContext”. Improve logging around context state, pipeline init, and capture source selection.
This commit is contained in:
12
src/App.tsx
12
src/App.tsx
@@ -33,6 +33,7 @@ import CameraEntropy from './components/CameraEntropy';
|
||||
import DiceEntropy from './components/DiceEntropy';
|
||||
import { InteractionEntropy } from './lib/interactionEntropy';
|
||||
|
||||
import AudioEntropy from './AudioEntropy';
|
||||
console.log("OpenPGP.js version:", openpgp.config.versionString);
|
||||
|
||||
interface StorageItem {
|
||||
@@ -736,6 +737,17 @@ function App() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Audio Entropy Component */}
|
||||
{entropySource === 'audio' && !generatedSeed && (
|
||||
<AudioEntropy
|
||||
key={`audio-${resetCounter}`}
|
||||
wordCount={seedWordCount}
|
||||
onEntropyGenerated={handleEntropyGenerated}
|
||||
onCancel={() => setEntropySource(null)}
|
||||
interactionEntropy={interactionEntropyRef.current}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Generated Seed Display + Destination Selector */}
|
||||
{generatedSeed && (
|
||||
<div className="space-y-4">
|
||||
|
||||
Reference in New Issue
Block a user