Home / Function/ createAudioAnalyser() — ui Function Reference

createAudioAnalyser() — ui Function Reference

Architecture documentation for the createAudioAnalyser() function in elevenlabs.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  c15d94b4_fd6f_c1de_3ea2_fce8c0f16259["createAudioAnalyser()"]
  140880de_8350_c565_0d8f_48f12ee18f06["elevenlabs.tsx"]
  c15d94b4_fd6f_c1de_3ea2_fce8c0f16259 -->|defined in| 140880de_8350_c565_0d8f_48f12ee18f06
  7ab52688_e5d2_1af3_4776_54f9178f4007["useAudioVolume()"]
  7ab52688_e5d2_1af3_4776_54f9178f4007 -->|calls| c15d94b4_fd6f_c1de_3ea2_fce8c0f16259
  309376d6_42d7_5ee3_cee2_ca32001fcef1["useMultibandVolume()"]
  309376d6_42d7_5ee3_cee2_ca32001fcef1 -->|calls| c15d94b4_fd6f_c1de_3ea2_fce8c0f16259
  style c15d94b4_fd6f_c1de_3ea2_fce8c0f16259 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/registry/bases/radix/blocks/elevenlabs.tsx lines 154–181

function createAudioAnalyser(
  mediaStream: MediaStream,
  options: AudioAnalyserOptions = {}
) {
  const audioContext = new (window.AudioContext ||
    (window as unknown as { webkitAudioContext: typeof AudioContext })
      .webkitAudioContext)()
  const source = audioContext.createMediaStreamSource(mediaStream)
  const analyser = audioContext.createAnalyser()

  if (options.fftSize) analyser.fftSize = options.fftSize
  if (options.smoothingTimeConstant !== undefined) {
    analyser.smoothingTimeConstant = options.smoothingTimeConstant
  }
  if (options.minDecibels !== undefined)
    analyser.minDecibels = options.minDecibels
  if (options.maxDecibels !== undefined)
    analyser.maxDecibels = options.maxDecibels

  source.connect(analyser)

  const cleanup = () => {
    source.disconnect()
    audioContext.close()
  }

  return { analyser, audioContext, cleanup }
}

Subdomains

Frequently Asked Questions

What does createAudioAnalyser() do?
createAudioAnalyser() is a function in the ui codebase, defined in apps/v4/registry/bases/radix/blocks/elevenlabs.tsx.
Where is createAudioAnalyser() defined?
createAudioAnalyser() is defined in apps/v4/registry/bases/radix/blocks/elevenlabs.tsx at line 154.
What calls createAudioAnalyser()?
createAudioAnalyser() is called by 2 function(s): useAudioVolume, useMultibandVolume.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free