dmrschmidt/DSWaveformImage
Generate waveform images from audio files on iOS, macOS & visionOS in Swift. Native SwiftUI & UIKit views.
✨ Added
- Multi-channel rendering, including a dedicated stereo mode. Renderers can now interpret audio as `.merged` (default, unchanged), `.specific(N)` for a single channel, or `.stereo` for a split L/R image. Use via `LinearWaveformRenderer(channelSelection:)` or the new `LinearWaveformRenderer.stereo` factory; pass `channelSelection:` to `WaveformAnalyzer.samples(...)` if you're consuming raw samples. See *Multi-Channel (Stereo) Support* in the README. https://github.com/dmrschmidt/DSWaveformImage/pull/111
🐛 Fixed
- Multi-hour audio files no longer crash with OOM ([#93](https://github.com/dmrschmidt/DSWaveformImage/issues/93)). The end-of-loop backfill in `WaveformAnalyzer` previously padded the input sample buffer with up to gigabytes of zeros when the read produced fewer samples than the target (most commonly when the reader was interrupted by backgrounding). It now pads the output array with silence-equivalent floats — allocation is O(target), independent of audio duration. Per-chunk reads are wrapped in `autoreleasepool` to keep `CMSampleBuffer` references from pinning memory during long reads.
- `CircularWaveformRenderer(kind: .ring(_))` now renders a true annulus for `.filled`, `.gradient`, `.outlined`, and `.gradientOutlined` (previously only `.striped` looked right; the others filled the inner disk).
📋 Changed
- `WaveformAnalyzer.AnalyzeError` gained `.invalidChannelIndex(requested:available:)` for the new `.specific(N)` selector. Source-breaking for exhaustive switches without `@unknown default:`.
- Full Changelog: https://github.com/dmrschmidt/DSWaveformImage/compare/14.4.0...14.5.0
**Full Changelog**: https://github.com/dmrschmidt/DSWaveformImage/compare/14.3.0...14.4.0
📋 What's Changed
- Allow passing `AVAsset` to waveform analyzer by @mihai8804858 in https://github.com/dmrschmidt/DSWaveformImage/pull/110
✨ New Contributors
- @mihai8804858 made their first contribution in https://github.com/dmrschmidt/DSWaveformImage/pull/110
- Full Changelog: https://github.com/dmrschmidt/DSWaveformImage/compare/14.2.2...14.3.0
Fixes an issue w/ striped rendering always drawing the last stripe as a line instead of a proper bar.
see #85
Re-add ability to position waveform when using the image APIs.
Bring back support for visionOS from [14.1.0](https://github.com/dmrschmidt/DSWaveformImage/releases/tag/14.1.0).
📋 Changes
- remove vision OS support for now again as it was causing troubles with Xcode 14
📋 Changes
- add the possibility to handle "loading" state in WaveformView - courtesy of @alfogrillo in #82
- add support for visionOS - courtesy of @tapsandswipes in #81
📋 Changes
- Minimum iOS Deployment target is 15.0, macOS is 12.0 to remove internal usage of deprecated APIs
- `WaveformAnalyzer` and `WaveformImageDrawer` now return `Result<[Float] | DSImage, Error>` when used with completionHandler for better error handling
- `WaveformAnalyzer` is now stateless and requires the URL in `.samples(fromAudioAt:count:qos:)` instead of its constructor
- SwiftUI's `WaveformView` has a new constructor that provides optional access to the underlying `WaveformShape`, which is now used for rendering, see [#78](https://github.com/dmrschmidt/DSWaveformImage/issues/78)
📋 What's Changed
- Add missing `@available` annotation for macOS in WaveformLiveCanvas view by @TikhonP in https://github.com/dmrschmidt/DSWaveformImage/pull/73
✨ New Contributors
- @TikhonP made their first contribution in https://github.com/dmrschmidt/DSWaveformImage/pull/73
- Full Changelog: https://github.com/dmrschmidt/DSWaveformImage/compare/13.0.1...13.0.2
📋 Changes
- bug fix for #71
Any mentions of `dampening` & similar were corrected to `damping` etc in [11460b8b](https://github.com/dmrschmidt/DSWaveformImage/commit/11460b8b8203f163868ba774d1533116d2fe68a1). Most notably in `Waveform.Configuration`. See https://github.com/dmrschmidt/DSWaveformImage/issues/64.
Includes a fix for #58.
📋 Changes
- The rendering pipeline was split out from the analysis. You can now create your own renderes by subclassing [`WaveformRenderer`](https://github.com/dmrschmidt/DSWaveformImage/blob/main/Sources/DSWaveformImage/Renderers/WaveformRenderer.swift).
- A new [`CircularWaveformRenderer`](https://github.com/dmrschmidt/DSWaveformImage/blob/main/Sources/DSWaveformImage/Renderers/CircularWaveformRenderer.swift) has been added.
- `position` was removed from `Waveform.Configuration`, see [0447737](https://github.com/dmrschmidt/DSWaveformImage/commit/044773782092becec0424527f6feef061988db7a).
- new `Waveform.Style` option have been added, see below
- filled: Use solid color for the waveform.
- outlined: Draws the envelope as an outline with the provided thickness.
- gradient: Use gradient based on color for the waveform.
- gradientOutlined: Use gradient based on color for the waveform. Draws the envelope as an outline with the provided thickness.
- + 1 more
📋 Changes
- fixes striped style's 1st stripe only being drawn half (see https://github.com/dmrschmidt/DSWaveformImage/issues/48#issuecomment-1312572313)
Adds support for native macOS Uses `NSImage` on macOS now, so the lib (and SwiftUI views) can be used from within plain macOS apps. To support this better, the library is split up into 2 parts now: ```swift import DSWaveformImage // for core classes to generate `UIImage` / `NSImage` directly import DSWaveformImageViews // if you want to use the native UIKit / SwiftUI views ``` Big shoutout to @jverkoey for [his PR to add native macOS support](https://github.com/dmrschmidt/DSWaveformImage/pull/44)! **Full Changelog**: https://github.com/dmrschmidt/DSWaveformImage/compare/10.1.0...11.0.0
Adds native SwiftUI views for both static rendering and live rendering. See [WaveformView](https://github.com/dmrschmidt/DSWaveformImage/blob/main/DSWaveformImage/DSWaveformImage/SwiftUI/WaveformView.swift) and [WaveformLiveCanvas](https://github.com/dmrschmidt/DSWaveformImage/blob/main/DSWaveformImage/DSWaveformImage/SwiftUI/WaveformLiveCanvas.swift). **Full Changelog**: https://github.com/dmrschmidt/DSWaveformImage/compare/10.0.1...10.1.0
10.0.0 changed the initial draw direction in the live view to always be right to left, even when there are still less samples than are needed to fill the entire view. While this kind of is a minor change, it is still changing existing behavior, which may break somebody's expectations.
