Merge branch 'develop' of https://github.com/ciderapp/Cider into develop
This commit is contained in:
commit
0433cede89
5 changed files with 505 additions and 466 deletions
|
@ -2,8 +2,8 @@
|
|||
"name": "cider",
|
||||
"applicationId": "Cider",
|
||||
"productName": "Cider",
|
||||
"version": "1.4.0",
|
||||
"description": "A new look into listening and enjoying music in style and performance.",
|
||||
"version": "1.4.1",
|
||||
"description": "A new cross-platform Apple Music experience based on Electron and Vue.js written from scratch with performance in mind.",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "./build/index.js",
|
||||
"author": "Cider Collective <cryptofyre@cider.sh> (https://cider.sh)",
|
||||
|
|
|
@ -128,6 +128,9 @@
|
|||
"term.song.link.generate": "正在取得 song.link 的分享網址...",
|
||||
"term.version": "版本",
|
||||
"term.creditDesignedBy": "由 ${authorUsername} 設計",
|
||||
"term.plugin" : "模組" ,
|
||||
"term.pluginMenu" : "模組選單" ,
|
||||
"term.pluginMenu.none" : "沒有交互式模組" ,
|
||||
"home.title": "首頁",
|
||||
"home.recentlyPlayed": "最近播放",
|
||||
"home.recentlyAdded": "最近加入",
|
||||
|
@ -286,15 +289,15 @@
|
|||
"settings.prompt.visual.theme.github.URL": "輸入你要安裝的主題網址",
|
||||
"settings.notyf.visual.theme.install.success": "主題成功安裝",
|
||||
"settings.notyf.visual.theme.install.error": "主題安裝失敗",
|
||||
"settings.header.visual.plugin": "套件",
|
||||
"settings.header.visual.plugin": "模組",
|
||||
"settings.option.visual.plugin.github.download": "從 GitHub 網址安裝",
|
||||
"settings.option.visual.plugin.github.explore": "探索 GitHub 套件",
|
||||
"settings.header.visual.plugin.github.page": "來自 GitHub 的套件",
|
||||
"settings.option.visual.plugin.github.explore": "探索 GitHub 模組",
|
||||
"settings.header.visual.plugin.github.page": "來自 GitHub 的模組",
|
||||
"settings.option.visual.plugin.github.install.confirm": "你確定要安裝 {{ repo }}?",
|
||||
"settings.prompt.visual.plugin.github.URL": "輸入你要安裝的套件網址",
|
||||
"settings.prompt.visual.plugin.github.success": "套件成功安裝,按「確認」以重新啟動 Cider",
|
||||
"settings.notyf.visual.plugin.install.success": "套件成功安裝",
|
||||
"settings.notyf.visual.plugin.install.error": "套件安裝失敗",
|
||||
"settings.prompt.visual.plugin.github.URL": "輸入你要安裝的模組網址",
|
||||
"settings.prompt.visual.plugin.github.success": "模組已成功安裝,請重新啟動 Cider 以套用。",
|
||||
"settings.notyf.visual.plugin.install.success": "模組成功安裝",
|
||||
"settings.notyf.visual.plugin.install.error": "模組安裝失敗",
|
||||
"settings.option.visual.theme.default": "預設",
|
||||
"settings.option.visual.theme.dark": "午夜黑",
|
||||
"settings.option.visual.showPersonalInfo": "顯示個人檔案",
|
||||
|
|
|
@ -10,6 +10,7 @@ const CiderAudio = {
|
|||
llpw: null,
|
||||
analogWarmth: null,
|
||||
recorderNode: null,
|
||||
intelliGainComp: null,
|
||||
},
|
||||
ccON: false,
|
||||
mediaRecorder: null,
|
||||
|
@ -37,7 +38,9 @@ const CiderAudio = {
|
|||
audioBands: null,
|
||||
vibrantbassNode: null,
|
||||
llpw: null,
|
||||
analogWarmth: null
|
||||
analogWarmth: null,
|
||||
recorderNode: null,
|
||||
intelliGainComp: null,
|
||||
}
|
||||
} catch (e) { }
|
||||
CiderAudio.source.connect(CiderAudio.context.destination);
|
||||
|
@ -51,7 +54,9 @@ const CiderAudio = {
|
|||
CiderAudio.source = CiderAudio.context.createMediaElementSource(mediaElem);
|
||||
} else { try { CiderAudio.source.disconnect(CiderAudio.context.destination) } catch (e) { } }
|
||||
CiderAudio.audioNodes.gainNode = CiderAudio.context.createGain()
|
||||
CiderAudio.source.connect(CiderAudio.audioNodes.gainNode);
|
||||
CiderAudio.audioNodes.intelliGainComp = CiderAudio.context.createGain();
|
||||
CiderAudio.source.connect(CiderAudio.audioNodes.intelliGainComp);
|
||||
CiderAudio.audioNodes.intelliGainComp.connect(CiderAudio.audioNodes.gainNode);
|
||||
if (app.cfg.audio.normalization) {
|
||||
CiderAudio.normalizerOn()
|
||||
}
|
||||
|
@ -137,6 +142,48 @@ const CiderAudio = {
|
|||
spatialOff: function () {
|
||||
CiderAudio.hierarchical_loading();
|
||||
},
|
||||
intelliGainComp_h0_0: function () {
|
||||
let filters = []; const precisionHz = 12;
|
||||
if (CiderAudio.audioNodes.audioBands !== null) {filters = filters.concat(CiderAudio.audioNodes.audioBands)}
|
||||
if (CiderAudio.audioNodes.vibrantbassNode !== null) {filters = filters.concat(CiderAudio.audioNodes.vibrantbassNode)}
|
||||
if (CiderAudio.audioNodes.llpw !== null && CiderAudio.audioNodes.llpw.length > 1) {filters = filters.concat(CiderAudio.audioNodes.llpw);}
|
||||
if (!filters || filters.length === 0) {CiderAudio.audioNodes.intelliGainComp.gain.value = 1; return}
|
||||
filters.shift();
|
||||
let steps = Math.ceil(96000 / precisionHz);
|
||||
// Generate input array for getFrequencyResponse method
|
||||
let frequencies = new Float32Array(steps);
|
||||
for (let i = 0; i < steps; i++) {
|
||||
frequencies[i] = (i + 1) * precisionHz;
|
||||
}
|
||||
// Here we will store combined amplitude response
|
||||
let totalAmplitudeResp = new Float32Array(steps);
|
||||
for (let i = 0; i < steps; i++) {
|
||||
totalAmplitudeResp[i] = 1;
|
||||
}
|
||||
// Temporary container for every filter response
|
||||
let amplitudeResp = new Float32Array(steps), phaseResp = new Float32Array(steps);
|
||||
for (let i = filters.length - 1; i >= 0; i--) {
|
||||
let filter = filters[i];
|
||||
// Get filter response and convolve it with existing response
|
||||
filter.getFrequencyResponse(frequencies, amplitudeResp, phaseResp);
|
||||
for (let j = 0; j < steps; j++) {
|
||||
totalAmplitudeResp[j] *= amplitudeResp[j];
|
||||
}
|
||||
}
|
||||
// Find max gain
|
||||
let maxGain = -120;
|
||||
for (let i = 0; i < steps; i++) {
|
||||
let gain = totalAmplitudeResp[i];
|
||||
if (gain > maxGain)
|
||||
maxGain = gain;
|
||||
}
|
||||
if (maxGain == -120) {maxGain = 1}
|
||||
if (CiderAudio.audioNodes.llpw !== null && CiderAudio.audioNodes.llpw[0].buffer !== null) {maxGain = maxGain * 1.0592537251772889}
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true && app.cfg.audio.maikiwiAudio.spatialProfile !== '70_421signature') {maxGain = maxGain * 1.3756248102753075}
|
||||
maxGain = Math.pow(10, (-1 * (20 * Math.log10(maxGain))) / 20).toFixed(4);
|
||||
maxGain > 1.0 ? CiderAudio.audioNodes.intelliGainComp.gain.value = 1 : CiderAudio.audioNodes.intelliGainComp.gain.value = maxGain;
|
||||
console.debug(`[Cider][Audio] IntelliGainComp: ${maxGain > 1.0 ? 0 : (20 * Math.log10(maxGain)).toFixed(2)} dB (${maxGain > 1.0 ? 1 : maxGain})`);
|
||||
},
|
||||
sendAudio: function () {
|
||||
if (!CiderAudio.ccON) {
|
||||
CiderAudio.ccON = true
|
||||
|
@ -146,6 +193,7 @@ const CiderAudio = {
|
|||
// mimeType: 'audio/webm; codecs=opus'
|
||||
// };
|
||||
// var destnode = CiderAudio.context.createMediaStreamDestination();
|
||||
// CiderAudio.audioNodes.intelliGainComp.connect(CiderAudio.audioNodes.gainNode);
|
||||
// CiderAudio.audioNodes.gainNode.connect(destnode)
|
||||
// CiderAudio.mediaRecorder = new MediaRecorder(destnode.stream, options);
|
||||
// CiderAudio.mediaRecorder.start(1);
|
||||
|
@ -400,7 +448,7 @@ const CiderAudio = {
|
|||
|
||||
}
|
||||
|
||||
console.debug("[Cider][Audio] CAP - MaikiwiSignature Mode");
|
||||
console.debug("[Cider][Audio] CAP - Maikiwi Signature Mode");
|
||||
break;
|
||||
|
||||
case "NATURAL":
|
||||
|
@ -517,6 +565,7 @@ const CiderAudio = {
|
|||
hierarchical_unloading: function () {
|
||||
try { CiderAudio.audioNodes.spatialNode.output.disconnect(); } catch (e) { }
|
||||
try { CiderAudio.audioNodes.spatialNode.disconnect(); } catch (e) { }
|
||||
try {CiderAudio.audioNodes.intelliGainComp.disconnect();} catch (e) { }
|
||||
try { CiderAudio.audioNodes.gainNode.disconnect(); } catch (e) { }
|
||||
try { for (var i of CiderAudio.audioNodes.analogWarmth) { i.disconnect(); } CiderAudio.audioNodes.analogWarmth = null } catch (e) { }
|
||||
try { for (var i of CiderAudio.audioNodes.llpw) { i.disconnect(); } CiderAudio.audioNodes.llpw = null } catch (e) { }
|
||||
|
@ -528,6 +577,7 @@ const CiderAudio = {
|
|||
},
|
||||
hierarchical_loading: function () {
|
||||
CiderAudio.hierarchical_unloading();
|
||||
CiderAudio.audioNodes.intelliGainComp.connect(CiderAudio.audioNodes.gainNode);
|
||||
|
||||
if (Math.max(...app.cfg.audio.equalizer.gain) != 0) {
|
||||
CiderAudio.equalizer(true, 0);
|
||||
|
@ -903,6 +953,7 @@ const CiderAudio = {
|
|||
}
|
||||
}
|
||||
}
|
||||
CiderAudio.intelliGainComp_h0_0();
|
||||
console.debug("[Cider][Audio] Finished hierarchical loading");
|
||||
|
||||
},
|
||||
|
|
|
@ -773,8 +773,8 @@ const app = new Vue({
|
|||
}
|
||||
numbers.shift()
|
||||
let peak = Math.max(numbers[6], numbers[7]) / 32768.0
|
||||
let gain = Math.pow(10, ((-7.63 - (Math.log10(peak) * 20)) / 20))// EBU R 128 Compliant
|
||||
console.debug(`[Cider][MaikiwiSoundCheck] Peak Gain: '${Math.log10(peak) * 20}' dB | Adjusting '${Math.log10(gain) * 20}' dB`)
|
||||
let gain = Math.pow(10, ((-2 - (Math.log10(peak) * 20)) / 20))// EBU R 128 Compliant
|
||||
console.debug(`[Cider][MaikiwiSoundCheck] Peak Gain: '${(Math.log10(peak) * 20).toFixed(2)}' dB | Adjusting '${(Math.log10(gain) * 20).toFixed(2)}' dB`)
|
||||
try {
|
||||
//CiderAudio.audioNodes.gainNode.gain.value = (Math.min(Math.pow(10, (replaygain.gain / 20)), (1 / replaygain.peak)))
|
||||
CiderAudio.audioNodes.gainNode.gain.value = gain
|
||||
|
@ -3857,23 +3857,6 @@ const app = new Vue({
|
|||
element.onclick = app.LastFMDeauthorize;
|
||||
});
|
||||
},
|
||||
/**
|
||||
parseSCTagToRG: function (tag) {
|
||||
let soundcheck = tag.split(" ")
|
||||
let numbers = []
|
||||
for (item of soundcheck) {
|
||||
numbers.push(parseInt(item, 16))
|
||||
|
||||
}
|
||||
numbers.shift()
|
||||
//let gain = Math.log10((Math.max(numbers[0], numbers[1]) ?? 1000) / 1000.0) * -10
|
||||
let peak = Math.max(numbers[6], numbers[7]) / 32768.0
|
||||
let gain = Math.pow(10, ((-7.63 - (Math.log10(peak) * 20)) / 20))// EBU R 128 Compliant
|
||||
return {
|
||||
gain: gain,
|
||||
peak: peak
|
||||
}
|
||||
},*/
|
||||
fullscreen(flag) {
|
||||
if (flag) {
|
||||
ipcRenderer.send('setFullScreen', true);
|
||||
|
|
|
@ -298,7 +298,7 @@
|
|||
try {
|
||||
for (var i = 0; i < 21; i++) {
|
||||
CiderAudio.audioNodes.vibrantbassNode[i].gain.value = app.cfg.audio.maikiwiAudio.vibrantBass.gain[i] * (app.cfg.audio.equalizer.vibrantBass / 10);
|
||||
}}
|
||||
} CiderAudio.intelliGainComp_h0_0();}
|
||||
catch(e) {
|
||||
CiderAudio.hierarchical_loading();
|
||||
}
|
||||
|
@ -314,12 +314,14 @@
|
|||
for (var i = 0; i < 10; i++) {
|
||||
CiderAudio.audioNodes.audioBands[i].gain.value = app.cfg.audio.equalizer.gain[i] * app.cfg.audio.equalizer.mix
|
||||
}
|
||||
} catch(e) {CiderAudio.hierarchical_loading();}
|
||||
CiderAudio.intelliGainComp_h0_0();
|
||||
} catch(e) {CiderAudio.hierarchical_loading(); }
|
||||
}
|
||||
},
|
||||
changeGain(i) {
|
||||
if (Math.max(...app.cfg.audio.equalizer.gain) != 0) {
|
||||
try {CiderAudio.audioNodes.audioBands[i].gain.value = app.cfg.audio.equalizer.gain[i] * app.cfg.audio.equalizer.mix}
|
||||
try {CiderAudio.audioNodes.audioBands[i].gain.value = app.cfg.audio.equalizer.gain[i] * app.cfg.audio.equalizer.mix
|
||||
CiderAudio.intelliGainComp_h0_0();}
|
||||
catch(e){CiderAudio.hierarchical_loading();}
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue