Update live waveform using rtaudio

This commit is contained in:
Hariharan Mudaliar 2026-04-04 23:39:48 +05:30
commit f7f29adea9
No known key found for this signature in database
GPG key ID: 025583EB0BE5640E
19 changed files with 893 additions and 5 deletions

View file

@ -476,7 +476,7 @@ struct ExtensionEdgeContentView: View {
.fill((colorDescriptor.isAccent ? accent : colorDescriptor.swiftUIColor).gradient)
.frame(width: 48, height: 14)
.mask {
AudioSpectrumView(isPlaying: .constant(true))
AudioVisualizerView(isPlaying: .constant(true))
.frame(width: 16, height: 12)
}
case let .animation(data, size):

View file

@ -326,7 +326,7 @@ struct LockScreenMusicPanel: View {
Rectangle()
.fill(Defaults[.coloredSpectrogram] ? Color(nsColor: musicManager.avgColor).gradient : Color.gray.gradient)
.mask {
AudioSpectrumView(isPlaying: .constant(musicManager.isPlaying))
AudioVisualizerView(isPlaying: .constant(musicManager.isPlaying))
.frame(width: width, height: height)
}
.frame(width: width, height: height)

View file

@ -110,7 +110,7 @@ struct MinimalisticMusicView: View {
.fill(Defaults[.coloredSpectrogram] ? Color(nsColor: musicManager.avgColor).gradient : Color.gray.gradient)
.frame(width: 50, alignment: .center)
.mask {
AudioSpectrumView(isPlaying: $musicManager.isPlaying)
AudioVisualizerView(isPlaying: $musicManager.isPlaying)
.frame(width: 16, height: 12)
}
.frame(width: max(0, vm.effectiveClosedNotchHeight - (isHovering ? 0 : 12)),

View file

@ -640,7 +640,7 @@ private struct MinimalisticReminderDetailsView: View {
Rectangle()
.fill(Defaults[.coloredSpectrogram] ? Color(nsColor: MusicManager.shared.avgColor).gradient : Color.gray.gradient)
.mask {
AudioSpectrumView(isPlaying: .constant(MusicManager.shared.isPlaying))
AudioVisualizerView(isPlaying: .constant(MusicManager.shared.isPlaying))
.frame(width: 20, height: 16)
}
.frame(width: 20, height: 16)

View file

@ -2615,6 +2615,20 @@ struct Media: View {
Text("Media playback live activity")
}
Section {
Defaults.Toggle(key: .enableRealTimeWaveform) {
HStack {
Text("Enable real-time waveform")
customBadge(text: "Beta")
}
}
.settingsHighlight(id: highlightID("Enable real-time waveform"))
} header: {
Text("Music Visualizer")
} footer: {
Text("When enabled, the music visualizer displays real-time audio spectrum data synced to your music. Requires macOS 14.2+ and uses minimal CPU/GPU resources via the Accelerate framework.")
}
Section {
Defaults.Toggle(key: .enableLockScreenMediaWidget) {
Text("Show lock screen media panel")