{
  "accessibility" : [
    "The drawing is one element with the image trait. Its label is a textual summary, \"Waveform, 48,000 samples, peak level 87 percent\" (`GlassL10n` `.waveformSummary`), and its value is the progress as a percentage when one is given.",
    "Played and unplayed bars differ in colour only because the same information is in the accessibility value and, in a player, in the time labels next to it."
  ],
  "category" : "media",
  "changelog" : [
    {
      "changes" : [
        "Release 1.1.0: see the project changelog."
      ],
      "date" : "2026-12-03",
      "version" : "1.1.0"
    },
    {
      "changes" : [
        "Initial release."
      ],
      "date" : "2026-12-02",
      "version" : "1.0.0"
    }
  ],
  "dependencies" : [
    {
      "id" : "glass-foundation",
      "version" : "1.1.0"
    }
  ],
  "description" : "Bounded, aggregated audio samples drawn with Canvas and described in text.",
  "examples" : [
    {
      "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassWaveformExample: GlassExample {\n    public static let componentID = \"glass-waveform\"\n    /// Aggregated once, when the example is created, not on every frame.\n    @State private var voice = GlassWaveformData(samples: Self.syntheticSamples(count: 48_000), maxBuckets: 96, aggregation: .rms)\n    @State private var peaks = GlassWaveformData(samples: Self.syntheticSamples(count: 48_000), maxBuckets: 160)\n    @State private var progress = 0.35\n\n    public init() {}\n\n    public var body: some View {\n        VStack(alignment: .leading, spacing: 16) {\n            Text(\"RMS, 96 buckets, with progress\")\n                .font(.headline)\n            GlassWaveform(voice, progress: progress)\n            Slider(value: $progress, in: 0...1) { Text(\"Progress\") }\n\n            Text(\"Peak, 160 buckets\")\n                .font(.headline)\n            GlassWaveform(peaks, minimumHeight: 72)\n\n            Text(\"Progress without the playhead\")\n                .font(.headline)\n            GlassWaveform(voice, progress: progress, showsPlayhead: false)\n\n            Text(\"No samples\")\n                .font(.headline)\n            GlassWaveform(.empty, minimumHeight: 24)\n\n            Text(\"Sample data · a synthetic signal built from sine waves.\")\n                .font(.caption)\n                .foregroundStyle(.secondary)\n        }\n        .padding()\n    }\n\n    /// A deterministic signal: a carrier shaped by two slow envelopes.\n    static func syntheticSamples(count: Int) -> [Float] {\n        (0..<count).map { index in\n            let t = Double(index) / Double(count)\n            let envelope = 0.55 + 0.45 * sin(t * .pi * 6)\n            let swell = 0.6 + 0.4 * cos(t * .pi * 17)\n            return Float(sin(Double(index) * 0.21) * envelope * swell)\n        }\n    }\n}\n\n#Preview(\"GlassWaveform\") { GlassWaveformExample().glassTheme(.aurora) }\n",
      "title" : "GlassWaveform example"
    }
  ],
  "files" : [
    {
      "bytes" : 11035,
      "path" : "Media/Media/GlassWaveform.swift",
      "sha256" : "682352cacdb8d27f8d8eefd0ceba9680660bbcbee389d0d92a0f2eeacd443950"
    }
  ],
  "frameworks" : [

  ],
  "id" : "glass-waveform",
  "kind" : "content-component",
  "license" : "MIT",
  "minimumOS" : {
    "iOS" : "26.0",
    "iPadOS" : "26.0",
    "macOS" : "26.0"
  },
  "name" : "GlassWaveform",
  "platforms" : [
    "iOS",
    "iPadOS",
    "macOS"
  ],
  "schemaVersion" : 1,
  "sha256" : "7f144181b19a878730b3d517bf4b0943aa6349520594b6424fa2c9630355397f",
  "symbols" : [
    "GlassWaveformAggregation",
    "GlassWaveformDownsampler",
    "GlassWaveformData",
    "GlassWaveform",
    "GlassWaveformLayout"
  ],
  "version" : "1.1.0"
}
