Read Aloud: Disable local voices on macOS 27
Some checks are pending
CI / Detect changes (push) Waiting to run
CI / Utilities Tests (push) Waiting to run
CI / Test () (push) Blocked by required conditions
CI / Test (macOS NFS) (push) Blocked by required conditions
CI / Build, Upload (push) Waiting to run

This commit is contained in:
Abe Jellinek 2026-09-30 11:40:55 -04:00
parent 941199c242
commit ca61760225
3 changed files with 14 additions and 2 deletions

View file

@ -17,7 +17,7 @@ var Zotero_Read_Aloud_First_Run = new function () {
};
this._createReadAloudFirstRun = function () {
let { lang, readAloudEnabledVoices, ftl, getReadAloudRemoteInterface } = io.dataIn;
let { lang, readAloudEnabledVoices, ftl, getReadAloudRemoteInterface, readAloudLocalVoicesUnavailable } = io.dataIn;
let browserWindow = this._iframe.contentWindow;
browserWindow.wrappedJSObject.createReadAloudFirstRun(Cu.cloneInto({
@ -26,6 +26,7 @@ var Zotero_Read_Aloud_First_Run = new function () {
ftl,
loggedIn: Zotero.Sync.Runner.enabled,
remoteInterface: getReadAloudRemoteInterface(browserWindow),
readAloudLocalVoicesUnavailable,
onOpenLink: (url) => {
let win = Services.wm.getMostRecentWindow('navigator:browser');
if (win) {

View file

@ -14,7 +14,7 @@ var Zotero_Read_Aloud_Voices = new function () {
};
this._createReadAloudVoices = function () {
let { lang, tier, readAloudEnabledVoices, ftl, getReadAloudRemoteInterface } = io.dataIn;
let { lang, tier, readAloudEnabledVoices, ftl, getReadAloudRemoteInterface, readAloudLocalVoicesUnavailable } = io.dataIn;
let browserWindow = this._iframe.contentWindow;
browserWindow.wrappedJSObject.createReadAloudVoices(Cu.cloneInto({
@ -23,6 +23,7 @@ var Zotero_Read_Aloud_Voices = new function () {
readAloudEnabledVoices,
ftl,
remoteInterface: getReadAloudRemoteInterface(browserWindow),
readAloudLocalVoicesUnavailable,
onOpenLink: (url) => {
let win = Services.wm.getMostRecentWindow('navigator:browser');
if (win) {

View file

@ -43,6 +43,13 @@ const ARRAYBUFFER_MAX_LENGTH = Services.appinfo.is64Bit
const READ_ALOUD_ENABLED_VOICES_PATH = PathUtils.join(Zotero.Profile.dir, 'readAloudEnabledVoices.json');
const READ_ALOUD_VOICE_DEFAULTS_PATH = PathUtils.join(Zotero.Profile.dir, 'readAloudVoiceDefaults.json');
// TEMP: Local voices make loud pops at the end of every utterance on macOS 27
// without a patch to libmozglue (a64e3671) that would be risky to backport, so
// disable them.
function areReadAloudLocalVoicesUnavailable() {
return Zotero.isMac && parseInt(Services.sysinfo.getProperty('version')) === 27;
}
// Whether the Read Aloud audio cache has been pruned of stale versions this session
let readAloudCachePruned = false;
@ -265,6 +272,7 @@ class ReaderInstance {
readAloudVoices: this._getReadAloudVoices(),
readAloudEnabledVoices: await this._getReadAloudEnabledVoices(),
readAloudRemoteInterface: this._getReadAloudRemoteInterface(this._iframeWindow),
readAloudLocalVoicesUnavailable: areReadAloudLocalVoicesUnavailable(),
readAloudHighlightGranularity: Zotero.Prefs.get('reader.readAloud.highlightGranularity'),
getSDTPack: this._createGetSDTPack(this._iframeWindow),
loggedIn: Zotero.Sync.Runner.enabled,
@ -1902,6 +1910,7 @@ class ReaderInstance {
readAloudEnabledVoices: await this._getReadAloudEnabledVoices(),
ftl,
getReadAloudRemoteInterface: win => this._getReadAloudRemoteInterface(win),
readAloudLocalVoicesUnavailable: areReadAloudLocalVoicesUnavailable(),
},
dataOut: null,
openVoicesDialog: ({ tier }) => {
@ -1932,6 +1941,7 @@ class ReaderInstance {
readAloudEnabledVoices: await this._getReadAloudEnabledVoices(),
ftl,
getReadAloudRemoteInterface: win => this._getReadAloudRemoteInterface(win),
readAloudLocalVoicesUnavailable: areReadAloudLocalVoicesUnavailable(),
},
dataOut: null,
};