feat(clients): event sound effects + optional text-to-speech
Add audible cues and optional spoken announcements for session events
(join/leave, channel + PM sent/recv, login, logout/connection-lost,
mic on/off, voice-activity, PTT) across all three clients, driven off
the shared C ABI vc_event stream so the mapping stays consistent.
TTS is off by default; when enabled it announces events and reads
message/PM bodies aloud. Master toggles + a sound-volume slider; the
per-utterance voice-activity and PTT cues default off. WAVs ship from
assets/sounds/.
Windows (built + verified): new VoiceCat.App/Notifications/ layer
(FeedbackSettings -> %AppData%\VoiceCat\feedback.json, SoundPlayerPool
via System.Media.SoundPlayer, SpeechAnnouncer via Prismatoid 0.3.0,
EventFeedback dispatcher); MainForm hooks; NotificationSettingsForm
under Settings > Notifications; csproj adds the Prismatoid PackageRef
and copies the WAVs into sounds\.
macOS + iOS (written, not yet built -- needs a Mac): shared
VoiceCatCore/Feedback/ (SoundEvent, EventFeedback = AVAudioPlayer pool
+ native AVSpeechSynthesizer, FeedbackSettings over UserDefaults); WAVs
bundled via Package.swift resources (.process). Hooks in SessionState/
AppState (iOS) and MainWindowController (macOS); settings UI in
SettingsView (iOS) and SettingsWindowController (macOS).
No core/server code touched; ctest --preset dev unaffected.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 15:20:11 +02:00
|
|
|
namespace VoiceCat.App.Notifications;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The set of audible event cues. Each maps to a WAV in the app's <c>sounds\</c> folder
|
|
|
|
|
/// (copied from <c>assets/sounds/</c> at build time). The same logical set is mirrored in the
|
|
|
|
|
/// macOS/iOS clients so feedback stays consistent across platforms.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public enum SoundEvent
|
|
|
|
|
{
|
chore: comment cleanup pass ahead of open-sourcing
Removes leftover debug scaffolding (stray Console.WriteLine/NSLog traces,
dead nick_buf_ptr, a no-op --print-config flag now implemented for real),
fixes stale/misleading comments (channel passwords are no longer a "future
M5+" feature, a wrong cross-reference, a stale TlsContext::close() mention,
an incomplete BanRecord::subject_type doc, and a smoke test pointing at a
build/m1-dev preset that no longer exists), strips internal M1-M5 milestone
jargon from comments now that the roadmap is done, trims comments that just
restated the following line, and consolidates a few "why" explanations that
were duplicated 2-3 times in the same file.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-03 10:20:18 +01:00
|
|
|
ChannelJoin,
|
|
|
|
|
ChannelLeave,
|
feat(clients): event sound effects + optional text-to-speech
Add audible cues and optional spoken announcements for session events
(join/leave, channel + PM sent/recv, login, logout/connection-lost,
mic on/off, voice-activity, PTT) across all three clients, driven off
the shared C ABI vc_event stream so the mapping stays consistent.
TTS is off by default; when enabled it announces events and reads
message/PM bodies aloud. Master toggles + a sound-volume slider; the
per-utterance voice-activity and PTT cues default off. WAVs ship from
assets/sounds/.
Windows (built + verified): new VoiceCat.App/Notifications/ layer
(FeedbackSettings -> %AppData%\VoiceCat\feedback.json, SoundPlayerPool
via System.Media.SoundPlayer, SpeechAnnouncer via Prismatoid 0.3.0,
EventFeedback dispatcher); MainForm hooks; NotificationSettingsForm
under Settings > Notifications; csproj adds the Prismatoid PackageRef
and copies the WAVs into sounds\.
macOS + iOS (written, not yet built -- needs a Mac): shared
VoiceCatCore/Feedback/ (SoundEvent, EventFeedback = AVAudioPlayer pool
+ native AVSpeechSynthesizer, FeedbackSettings over UserDefaults); WAVs
bundled via Package.swift resources (.process). Hooks in SessionState/
AppState (iOS) and MainWindowController (macOS); settings UI in
SettingsView (iOS) and SettingsWindowController (macOS).
No core/server code touched; ctest --preset dev unaffected.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 15:20:11 +02:00
|
|
|
ChannelRecv, // channel text message from someone else
|
|
|
|
|
ChannelSent, // channel text message I sent
|
chore: comment cleanup pass ahead of open-sourcing
Removes leftover debug scaffolding (stray Console.WriteLine/NSLog traces,
dead nick_buf_ptr, a no-op --print-config flag now implemented for real),
fixes stale/misleading comments (channel passwords are no longer a "future
M5+" feature, a wrong cross-reference, a stale TlsContext::close() mention,
an incomplete BanRecord::subject_type doc, and a smoke test pointing at a
build/m1-dev preset that no longer exists), strips internal M1-M5 milestone
jargon from comments now that the roadmap is done, trims comments that just
restated the following line, and consolidates a few "why" explanations that
were duplicated 2-3 times in the same file.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-03 10:20:18 +01:00
|
|
|
PmRecv,
|
|
|
|
|
PmSent,
|
|
|
|
|
Login,
|
|
|
|
|
Logout,
|
|
|
|
|
ConnectionLost,
|
|
|
|
|
VoiceOn,
|
|
|
|
|
VoiceOff,
|
feat(clients): event sound effects + optional text-to-speech
Add audible cues and optional spoken announcements for session events
(join/leave, channel + PM sent/recv, login, logout/connection-lost,
mic on/off, voice-activity, PTT) across all three clients, driven off
the shared C ABI vc_event stream so the mapping stays consistent.
TTS is off by default; when enabled it announces events and reads
message/PM bodies aloud. Master toggles + a sound-volume slider; the
per-utterance voice-activity and PTT cues default off. WAVs ship from
assets/sounds/.
Windows (built + verified): new VoiceCat.App/Notifications/ layer
(FeedbackSettings -> %AppData%\VoiceCat\feedback.json, SoundPlayerPool
via System.Media.SoundPlayer, SpeechAnnouncer via Prismatoid 0.3.0,
EventFeedback dispatcher); MainForm hooks; NotificationSettingsForm
under Settings > Notifications; csproj adds the Prismatoid PackageRef
and copies the WAVs into sounds\.
macOS + iOS (written, not yet built -- needs a Mac): shared
VoiceCatCore/Feedback/ (SoundEvent, EventFeedback = AVAudioPlayer pool
+ native AVSpeechSynthesizer, FeedbackSettings over UserDefaults); WAVs
bundled via Package.swift resources (.process). Hooks in SessionState/
AppState (iOS) and MainWindowController (macOS); settings UI in
SettingsView (iOS) and SettingsWindowController (macOS).
No core/server code touched; ctest --preset dev unaffected.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 15:20:11 +02:00
|
|
|
VaStart, // my voice-activity began (off by default)
|
|
|
|
|
VaStop, // my voice-activity ended (off by default)
|
|
|
|
|
Ptt, // push-to-talk engaged (off by default)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal static class SoundEventExtensions
|
|
|
|
|
{
|
|
|
|
|
/// <summary>WAV file name (without directory) for each event, matching assets/sounds/.</summary>
|
|
|
|
|
public static string FileName(this SoundEvent ev) => ev switch
|
|
|
|
|
{
|
|
|
|
|
SoundEvent.ChannelJoin => "channel_join.wav",
|
|
|
|
|
SoundEvent.ChannelLeave => "channel_leave.wav",
|
|
|
|
|
SoundEvent.ChannelRecv => "channel_recv.wav",
|
|
|
|
|
SoundEvent.ChannelSent => "channel_sent.wav",
|
|
|
|
|
SoundEvent.PmRecv => "pm_recv.wav",
|
|
|
|
|
SoundEvent.PmSent => "pm_sent.wav",
|
|
|
|
|
SoundEvent.Login => "login.wav",
|
|
|
|
|
SoundEvent.Logout => "logout.wav",
|
|
|
|
|
SoundEvent.ConnectionLost => "connection_lost.wav",
|
|
|
|
|
SoundEvent.VoiceOn => "voice_on.wav",
|
|
|
|
|
SoundEvent.VoiceOff => "voice_off.wav",
|
|
|
|
|
SoundEvent.VaStart => "va_start.wav",
|
|
|
|
|
SoundEvent.VaStop => "va_stop.wav",
|
|
|
|
|
SoundEvent.Ptt => "ptt.wav",
|
|
|
|
|
_ => throw new ArgumentOutOfRangeException(nameof(ev), ev, null),
|
|
|
|
|
};
|
|
|
|
|
}
|