惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
Y
Y Combinator Blog
罗磊的独立博客
J
Java Code Geeks
人人都是产品经理
人人都是产品经理
MongoDB | Blog
MongoDB | Blog
The GitHub Blog
The GitHub Blog
G
Google Developers Blog
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky
Jina AI
Jina AI
F
Fortinet All Blogs
H
Help Net Security
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Last Week in AI
Last Week in AI
博客园 - 司徒正美
云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
C
Check Point Blog
GbyAI
GbyAI

Cyberia

复活吧微软边缘 - Cyberia 从零开始的EAC抓轨教程 - Cyberia Apophenia, 新时代补全工具 - Cyberia 浅谈博客设计 - Cyberia 爱软TV之GitHub - Cyberia 排印演进 - Cyberia EAC相关工具集合 - Cyberia 《C(金钱掌控)》观后感 - Cyberia C#在Windows UI开发中的衰落 - Cyberia 存储退潮 字体padding计算器 开源已死 如何写出优雅完整的音频元数据 自动化EAC音频抓取 起夜级家庭网络正在变得越来越重要 优化Powershell的启动时间 无JavaScript其实没有很重要 你不需要一个电纸书阅读器 文件分享的难题 为什么我不敢看都市 某科学的 SSH 算号指南 时代的辉夜姬 为什么 Pixi 是神 关于神椿的过去,当下以及未来,我的一点看法 Tahoe 的图标令人难评 The EVE of PUSHING LIMITS 在 Word 中通过制表符实现居中对齐等操作 编码之殇:前 Unicode 时代的 WAV 处理 sHELL 即地狱 WR1800K AX NAND 路由器刷入 Immortalwrt
自动化处理 Amazon Music 文件 MD5 不一致问题
Nullpinter · 2024-05-01 · via Cyberia

当你从某些特殊渠道拿到Amazon Music的音频文件的时候,你会发现其Hi-Res FLAC文件md5与其他平台售卖版本不同,这是因为其前面有空采样。因此只需去除空采样即可达到“Bit Perfect”。故写这一脚本自动化处理具有错误md5的文件。

# This code is distributed under the Apache 2.0 License.

# author: nptr

$files = Get-ChildItem -Recurse -Filter *.flac | Select-Object FullName, BaseName

$files | ForEach-Object {

$fullName = $_.FullName

$fileName = $_.BaseName

Write-Host Processing $fileName

$flag = metaflac --show-tag=BP $fullName

$res = metaflac --show-sample-rate $fullName

$skip = 0

switch ($res) {

44100 { $skip = 286 }

48000 { $skip = 312 }

96000 { $skip = 624 }

192000 { $skip = 1248 }

Default { $skip = 0 }

}

if ($flag -ne "BP=1") {

Write-Host SampleRate: $($res / 1000)kHz, skip $skip

if ($skip -ne 0) {

flac -8 --skip=$skip -f $fullName

metaflac --set-tag=BP=1 $fullName

}

}

else {

Write-Host Skipping $fileName

}

}

用到了PowerShell7以及metaflac,相信聪明的你能够解决这两个问题。