mac 系统无法记住 AirPods 音量

2024-01-26 09:04:25 +08:00
 dawee2y

macos 14 airPods pro 二代

耳机连接 mac ,就默认把音量调到了一半处,手动调小之后,如果断开一会再连接,音量又是在一半位置,有什么办法可以永久记住上次的音量吗?

3300 次点击
所在节点    macOS
26 条回复
wh2724
131 天前
macOS 15.0.1 仍有这个问题,依旧没修复
littlewing
98 天前
15.1.1 仍然有这个问题
clevo
72 天前
尼玛的果然是 bug 最新依旧
ephemeron
64 天前
真的被这个 Bug 折磨,用 Hammerspoon 加改了一下上面那个兄弟的代码,完美解决了我的问题。

-- 存储上一次默认音频输出设备的名称
local lastOutputDeviceName = hs.audiodevice.defaultOutputDevice():name()

-- 处理设备变更的回调函数
local function handleDeviceChanges()
-- 获取当前默认音频输出设备的名称
local currentOutputDeviceName = hs.audiodevice.defaultOutputDevice():name()
-- 判断设备名称是否发生了变化
if lastOutputDeviceName ~= currentOutputDeviceName then
-- 判断当前设备是否为蓝牙耳机
if string.find(currentOutputDeviceName, "AirPods") then
-- 连接蓝牙耳机时将音量设置为 20
hs.audiodevice.defaultOutputDevice():setVolume(20)
hs.alert.show("音量已设为 20")
-- 判断上一个设备是否为蓝牙耳机
elseif string.find(lastOutputDeviceName, "AirPods") then
-- 断开蓝牙耳机时将音量设置为 0
hs.audiodevice.defaultOutputDevice():setVolume(0)
hs.alert.show("音量已设为 0")
end
end
-- 更新 lastOutputDeviceName 为当前设备名称
lastOutputDeviceName = currentOutputDeviceName
end

-- 为音频设备变动设置回调函数
hs.audiodevice.watcher.setCallback(handleDeviceChanges)
-- 启动音频设备监听器
hs.audiodevice.watcher.start()
retamia
60 天前
感谢#24 楼的方法。终究解决这个问题了。

发布会上还提听力健康,损害听力健康的 BUG 反而 1 年多没去修。 真的是 only apple can do
Wenfang
48 天前
补充 #24 ,用下面的 hammerspoon 配置可以用快捷键提示当前的音量

```lua
-- Function to print the current volume
function printCurrentVolume()
local volume = hs.audiodevice.defaultOutputDevice():volume()
hs.alert.show("Current volume: " .. volume)
end

-- Bind the function to a hotkey, for example, Ctrl + Alt + V
hs.hotkey.bind({"ctrl", "alt"}, "V", printCurrentVolume)
```

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1011644

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX