@willwade/aac-processors
    Preparing search index...

    Class SnapProcessor

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    • Add audio recording to a button in the database

      Parameters

      • dbPath: string
      • buttonId: number
      • audioData: Uint8Array
      • Optionalmetadata: string

      Returns Promise<number>

    • Helper method to add extracted strings to the map, handling duplicates

      Parameters

      • extractedMap: Map<string, ExtractedString>

        Map to store extracted strings

      • key: string

        Lowercase key for deduplication

      • originalString: string

        Original string with proper casing

      • vocabLocation: VocabLocation

        Metadata about where the string was found

      Returns void

    • Create a copy of the pageset with audio recordings added

      Parameters

      • sourceDbPath: string
      • targetDbPath: string
      • audioMappings: Map<number, { audioData: Uint8Array; metadata?: string }>

      Returns Promise<void>

    • Extract buttons from a specific page that need audio recordings

      Parameters

      • dbPath: string
      • pageUniqueId: string

      Returns { hasAudio: boolean; id: number; label: string; message: string }[]

    • Get available PageLayouts for a Snap file Useful for UI components that want to let users select layout size

      Parameters

      • filePath: string

        Path to the Snap file

      Returns Promise<PageLayoutInfo[]>

      Promise resolving to available PageLayouts with their dimensions

    • Parameters

      • filePathOrBuffer: ProcessorInput
      • translations: Map<string, string>
      • outputPath: string

      Returns Promise<Uint8Array>