fix normalization
This commit is contained in:
parent
12995da34a
commit
0a947257b2
1 changed files with 19 additions and 0 deletions
|
@ -9,6 +9,8 @@ import * as fs from "fs";
|
|||
import { Stream } from "stream";
|
||||
import * as qrcode from "qrcode-terminal";
|
||||
import * as os from "os";
|
||||
import * as mm from 'music-metadata';
|
||||
import fetch from 'electron-fetch'
|
||||
import {wsapi} from "./wsapi";
|
||||
|
||||
export class Win {
|
||||
|
@ -457,6 +459,23 @@ export class Win {
|
|||
*/
|
||||
})
|
||||
|
||||
// Get previews for normalization
|
||||
electron.ipcMain.on("getPreviewURL", (_event, url) => {
|
||||
'get url'
|
||||
fetch(url)
|
||||
.then(res => res.buffer())
|
||||
.then(async(buffer) => {
|
||||
try {
|
||||
const metadata = await mm.parseBuffer(buffer, 'audio/x-m4a');
|
||||
let SoundCheckTag = metadata.native.iTunes[1].value
|
||||
console.log('sc',SoundCheckTag)
|
||||
this.win.webContents.send('SoundCheckTag', SoundCheckTag)
|
||||
} catch (error) {
|
||||
console.error(error.message);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
/* *********************************************************************************************
|
||||
* Window Events
|
||||
* **********************************************************************************************/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue