mirror of
https://github.com/zotero/zotero.git
synced 2026-10-07 02:58:09 +00:00
Read Aloud: Disable local voices on macOS 27
Some checks are pending
Some checks are pending
This commit is contained in:
parent
941199c242
commit
ca61760225
3 changed files with 14 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue