Documentation
    Preparing search index...

    Function createAudioService

    • Create an audio service handler.

      The audio service is a state registry that tracks active audio sources per napplet window. Napplets announce audio state via audio:* topic events; the service tracks sources and can relay mute commands back.

      Parameters

      Returns ServiceHandler

      A ServiceHandler to register with the runtime

      import { createAudioService } from '@kehto/services';

      const audio = createAudioService({
      onChange: (sources) => {
      // Update UI with current audio sources
      for (const [windowId, source] of sources) {
      console.log(`${source.title} (${source.muted ? 'muted' : 'playing'})`);
      }
      },
      });

      runtime.registerService('audio', audio);