优化WS自建链接初始化,新增自定义提醒铃声 - #22
Merged
Merged
Conversation
「我的 - 通知提醒」新增「提醒铃声」入口,用户可选 10 个内置铃声之一或跟随系统默认。 选择保存到服务端 user_device.sound,推送时由服务端写进 aps.sound。 不需要 Notification Service Extension:服务端直接给文件名即可,因此没有新建 target、 没有 App Group、也不需要给 payload 加 mutable-content。 - 音频全部由 iosApp/tools/gen_notification_sounds.py 程序合成,无第三方素材因而无版权 问题。5 个短提示音 + 5 个持续提醒(3/5/10/15/20 秒)。 - 持续提醒是「短动机 + 静音间隔」循环而不是一段连续长音:连续长音听久了烦躁且没有可辨识 的节拍。五个时长共用同一个三音上行琶音动机,音量逐次渐强,10 秒以上的版本重复间隔还会 逐渐缩短。生成时有断言保证末次间隔大于动机长度,否则前一次没响完下一次就压上来会糊掉。 - 编码用 IMA4 而不是 16bit PCM:长铃声按 PCM 存要 4.67MB,对包体积不可接受,IMA4 是 Apple 支持的通知音格式之一且为 4:1,10 个文件共 1.3MB。脚本会把编码后的音频解码回 PCM 逐样本比对算 SNR(当前 31~37dB),低于 30dB 会告警。 - 试听用 AVAudioPlayer 而不是 AudioServicesPlaySystemSound:后者没有停止 API,而持续 提醒最长 20 秒,试听不能中断不可接受。音频会话用 ambient 而不是 playback,让试听和真实 通知一样被静音开关屏蔽,否则用户静音下试听有声、真收消息没声音会当成 bug。 - 顺带修掉「通知设置」弹窗里「还可以设置通知的铃声」这句错误文案:iOS 系统设置里只有声音 开关,没有铃声选择器,这句话一直在给用户错误预期。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.