Firefox audio output issues fix (#1510)
--------- Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
@@ -58,8 +58,12 @@ export const getSetting = <T>(name: string, defaultValue: T): T => {
|
||||
export const setSetting = <T>(name: string, newValue: T) =>
|
||||
setLocalStorageItem(getSettingKey(name), JSON.stringify(newValue));
|
||||
|
||||
const canEnableSpatialAudio = () => {
|
||||
export const isFirefox = () => {
|
||||
const { userAgent } = navigator;
|
||||
return userAgent.includes("Firefox");
|
||||
};
|
||||
|
||||
const canEnableSpatialAudio = () => {
|
||||
// Spatial audio means routing audio through audio contexts. On Chrome,
|
||||
// this bypasses the AEC processor and so breaks echo cancellation.
|
||||
// We only allow spatial audio to be enabled on Firefox which we know
|
||||
@@ -69,7 +73,7 @@ const canEnableSpatialAudio = () => {
|
||||
// widely enough, we can allow spatial audio everywhere. It's currently in a
|
||||
// chrome flag, so we could enable this in Electron if we enabled the chrome flag
|
||||
// in the Electron wrapper.
|
||||
return userAgent.includes("Firefox");
|
||||
return isFirefox();
|
||||
};
|
||||
|
||||
export const useSpatialAudio = (): DisableableSetting<boolean> => {
|
||||
|
||||
Reference in New Issue
Block a user