Menu ▾ ▴

#446 Notification sound picker: list each OS's own sounds

open
nobody
6 days ago
6 days ago
Anonymous
No

Originally created by: kristofferR

Problem

[#363] adds a notification sound picker, with bundled sounds and "Choose file…". Every OS already ships notification sounds people know from other apps, and listing them is cheaper and more familiar than bundling our own. Some platforms also limit what a notification can play, which the picker has to follow.

Goal

The [#363] picker lists the sounds the OS provides, and each choice plays reliably on that platform.

Scope

  • macOS: list .aiff, .caf and .wav from /System/Library/Sounds and ~/Library/Sounds, by name without the extension. Deliver with UNNotificationSound.soundNamed, which looks in both folders, so nothing is copied. Preview with NSSound(named:).
  • Windows: list the built-in toast sounds (ms-winsoundevent:Notification.Default, .IM, .Mail, .Reminder, .SMS). Today Chatpane always uses Notification.Default (windows/toast.rs). Microsoft documents custom toast audio files (ms-appx:, ms-appdata:) only for packaged apps, and Chatpane is installed without a package. So a bundled or chosen file means a silent toast (<audio silent="true"/>) and Chatpane plays the file itself. Confirm on a real build.
  • Linux: Chatpane sends the sound-name hint message-new-instant today. Offer the message-related names from the active freedesktop sound theme (for example message-new-instant, message, bell). Many notification daemons ignore sound hints, though, so for reliable sound Chatpane should play the file itself and send suppress-sound. Decide during [#363] whether that is always or only for daemons that don't advertise the sound capability.
  • Store the choice by platform and name. If a saved sound has disappeared, fall back to the default.

Verification

  • On each platform, each listed sound previews and plays on a real notification, grouped and ungrouped. Off stays silent.
  • macOS: a sound added to ~/Library/Sounds shows up the next time Settings opens.
  • Linux: tested on a daemon that plays sound hints (GNOME or KDE) and one that doesn't (mako or Omarchy's).

Part of [#363].

Related

Tickets: #363
Tickets: #451

Discussion


Log in to post a comment.