Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.
TypeScript adeagent-ideai-agentsautomationbotclaude-codecodexghosttygrok-bothermes-agentmobile-appmuseopenclawopencodeorchestrationpiruntimeterminalworktreesyc-backed
import { describe, expect, it } from 'vitest'
import {
analyzeDictationAudioChunk,
createDictationMeterAnalyzerState
} from './dictation-audio-meter'
describe('dictation audio meter', () => {
it('uses a fast attack and slower release for a stable voice envelope', () => {
const initial = createDictationMeterAnalyzerState()
const loud = analyzeDictationAudioChunk(new Float32Array(128).fill(0.3), 100, initial)
const quiet = analyzeDictationAudioChunk(new Float32Array(128), 200, loud)
expect(loud.level).toBeGreaterThan(0.5)
expect(loud.isSpeaking).toBe(true)
expect(quiet.level).toBeGreaterThan(0.3)
expect(quiet.level).toBeLessThan(loud.level)
})
it('holds clipping briefly so a single peak does not flicker', () => {
const initial = createDictationMeterAnalyzerState()
const clipped = analyzeDictationAudioChunk(new Float32Array([1]), 1_000, initial)
const held = analyzeDictationAudioChunk(new Float32Array([0]), 1_400, clipped)
const released = analyzeDictationAudioChunk(new Float32Array([0]), 1_600, held)
expect(clipped.isClipping).toBe(true)
expect(held.isClipping).toBe(true)
expect(released.isClipping).toBe(false)
})
})