Skip to content
WONGCW 網誌
  • 首頁
  • 論壇
  • 微博
  • 壁紙下載
  • 免費圖床
  • 視頻下載
  • 聊天室
  • SEO工具
  • 支援中心
  • 表格製作
  • More
    • 在線名片
    • 網頁搜索
    • 天氣預報
    • 二維碼生成器
  • Search Icon

WONGCW 網誌

記錄生活經驗與點滴

Windows 10 BUG會破壞FLAC音頻文件修復修復

Windows 10 BUG會破壞FLAC音頻文件修復修復

2021-06-02 Comments 0 Comment
QQ截圖20210602100734.jpg

這個BUG影響Windows 10專業版、家庭版、企業版、工作站和其他SKU版本。根據本月早些時候發布的支持文件,Windows 10的文件資源管理器的錯誤將破壞某些FLAC文件,這些文件在FLAC頭之前包含一個ID3框架。ID3是一個框架,它負責存儲信息,如音樂標題、藝術家、專輯、曲目編號等。

在Windows 10 系統,FLAC處理程序忽略了ID3框架,因為它認為FLAC文件在開頭使用4字節的fLaC。當音樂文件被用戶編輯時,ID3 框架被覆蓋了,沒有​​開始代碼。因此,音樂播放器無法識別修改後的文件。如果音樂文件的標題、藝術家或其他元數據在文件資源管理器中被改變,音樂文件就不會播放或加載。

幸運的是,微軟已經確定了根本原因,現在可以通過Windows Update進行修復。在KB5003214更新的更新日誌中,微軟確認該錯誤已被修復,如果你改變了他們的標題、藝術家或其他元數據,自由無損音頻編解碼器(FLAC)音樂文件將不再變得無法播放。

對於那些有損壞的音樂文件,微軟已經發布了一個新的PowerShell腳本,你可以運行它來使文件再次播放。然而,它不能恢復存儲在ID3框架中的丟失的元數據。為了避免FLAC音樂文件在未來出現問題,微軟建議應用本月的可選累積更新。

解決方案

1. 打開記事本

2. 将以下脚本代码复制到记事本中

# Copyright 2021 Microsoft

# This script will repair a FLAC file that has been corrupted by Media Foundation in reference to KB5003430.

# Refer to KB5003430 for further information

param(

[parameter(Mandatory =$ true,

HelpMessage = “The path to the FLAC file that has been corrupted by Media Foundation”,

ValueFromRemainingArguments =$ true)]

[ValidateScript({ -not [String]::IsNullOrEmpty( $_) -and (Test-Path $_) })]

[String] $ File

)

# We need to back up the current file incase we have any errors

$ FileDirectory = Split-Path -Resolve $ File

$ Filename = Split-Path -Leaf -Resolve $ File

$ FullPath = Join-Path -Resolve $ FileDirectory $ Filename

$ Filename = [String]::Format(“Backup_{0:yyyyMMdd_hhmmss}_{1}”, [DateTime]::Now, $ Filename)

$ BackupLocation = Join-Path $ FileDirectory $ Filename

Write-Output “Microsoft FLAC Repair Tool. This tool will repair a FLAC audio file that was corrupted when editing its details.”

Write-Output “Affected File: $ FullPath”

Write-Output “A backup of the file will be made: $ BackupLocation”

Write-Output “Do you wish to continue?”

$ choice =$ host.ui.PromptForChoice(“Fixing FLAC Script”, “Do you wish to continue”, (‘&Yes’, ‘&No’), 1)

function ParseStreamInfoMetADATABlock([System.IO.FileStream] $ stream)

{

$ blockType = $ stream.ReadByte()

$ lastBlock = ($ blockType -shr 7) -ne 0

$ blockType = $ blockType -band 0x7F

if ($ blockType -ne 0)

{

return $ false

}

$ blockSize = (($ stream.ReadByte() -shl 16) -bor ($ stream.ReadByte() -shl 8) -bor $ stream.ReadByte())

if ($ blockSize -lt 34)

{

return $ false

}

$ minAudioBlockSize = ($ stream.ReadByte() -shl 8) -bor $ stream.ReadByte()

$ maxAudioBlockSize = ($ stream.ReadByte() -shl 8) -bor $ stream.ReadByte()

if ($ minAudioBlockSize -lt 16 -or $ maxAudioBlockSize -lt 16)

{

return $ false

}

$ minFrameSize = (($ stream.ReadByte() -shl 16) -bor ($ stream.ReadByte() -shl 8) -bor $ stream.ReadByte())

$ maxFrameSize = (($ stream.ReadByte() -shl 16) -bor ($ stream.ReadByte() -shl 8) -bor $ stream.ReadByte())

$ sampleInfo = (($ stream.ReadByte() -shl 24) -bor ($ stream.ReadByte() -shl 16) -bor ($ stream.ReadByte() -shl 8) -bor $ stream.ReadByte())

$ sampleRate = $ sampleInfo -shr 12

$ channelCount = (($ sampleInfo -shr 9) -band 0x7) + 1

$ bitsPerSample = (($ sampleInfo -shr 4) -band 0x1F) + 1

[UInt64] $ sampleCount = (($ stream.ReadByte() -shl 24) -bor ($ stream.ReadByte() -shl 16) -bor ($ stream.ReadByte() -shl 8) -bor $ stream.ReadByte())

$ sampleCount = (([UInt64] $ sampleInfo -band 0xF) -shl 32) -bor $ sampleCount

$ MD5HashBytes = New-Object byte[] 16

$ stream.Read( $ MD5HashBytes, 0, $ MD5HashBytes.Length)

$ MD5Hash = [Guid]( $ MD5HashBytes)

if ($ sampleRate -eq 0)

{

return $ false

}

# Passing these checks means that we likely have a stream info header and can rebuild the file

Write-Output “File Stream Information”

Write-Output “Sample Rate: $ sampleRate”

Write-Output “Audio Channels: $ channelCount”

Write-Output “Sample Depth: $ bitsPerSample”

Write-Output “MD5 Audio Sample Hash: $ MD5Hash”

return $ true

}

if ($ choice -eq 0)

{

Copy-Item $ FullPath -Destination $ BackupLocation -Force

$ stream = [System.IO.File]::Open( $ FullPath, [System.IO.FileMode]::Open)

$ stream.Seek(4, [System.IO.SeekOrigin]::Begin)

while ($ stream.ReadByte() -eq 0) {}

# We now need to figure out where a valid FLAC metadata frame begins

# We are likely pointing to the last byte of the size member so we’ll seek back 4 bytes and retry

$ flacDataStartPosition = $ stream.Position – 4

$ stream.Seek( $ flacDataStartPosition, [System.IO.SeekOrigin]::Begin)

while (-not(ParseStreamInfoMetadataBlock( $ stream)))

{

$ flacDataStartPosition = $ flacDataStartPosition + 1

$ stream.Seek( $ flacDataStartPosition, [System.IO.SeekOrigin]::Begin)

}

# Insert the start code

$ stream.Seek( $ flacDataStartPosition, [System.IO.SeekOrigin]::Begin)

if (Test-Path “$ FullPath.tmp”)

{

Remove-Item “$ FullPath.tmp”

}

$ fixedStream = [System.IO.File]::Open(” $ FullPath.tmp”, [System.IO.FileMode]::CreateNew)

[byte[]] $ startCode = [char[]](‘f’, ‘L’, ‘a’, ‘C’);

$fixedStream.Write($startCode, 0, $startCode.Length)

$stream.CopyTo($fixedStream)

$流。關閉()

$fixedStream.Close()

Move-Item -Force “$ FullPath.tmp” $ FullPath

}

3. 文件菜單上,點擊保存。

4. 在”另存為”對話框中,找到你要保存PowerShell腳本的文件夾。

5. 在文件名框中,輸入FixFlacFiles.ps1,將保存類型框改為文本文檔(*.txt),然後點擊保存。

6. 在Windows Explorer中,找到你保存的PowerShell腳本。

7. 右鍵單擊該腳本,然後單擊用PowerShell運行。

8. 當有提示時,輸入無法播放的FLAC文件的文件名,然後按回車鍵。

分享此文:

  • 按一下即可分享至 X(在新視窗中開啟) X
  • 按一下以分享至 Facebook(在新視窗中開啟) Facebook
  • 分享到 WhatsApp(在新視窗中開啟) WhatsApp
  • 按一下以分享到 Telegram(在新視窗中開啟) Telegram
  • 分享到 Pinterest(在新視窗中開啟) Pinterest
  • 分享到 Reddit(在新視窗中開啟) Reddit
  • 按一下即可以電子郵件傳送連結給朋友(在新視窗中開啟) 電子郵件
  • 點這裡列印(在新視窗中開啟) 列印

相關


網絡資訊

Post navigation

PREVIOUS
ISS將迎來特殊客人:SpaceX將為NASA運送小魷魚和水熊
NEXT
美光發布首批PCIe 4.0固態硬盤:採用自研主控+176層3D TLC閃存

發表迴響取消回覆

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料。

More results...

Generic filters
Exact matches only
Search in title
Search in content
Search in excerpt
Filter by 分類
網站公告
Featured
限時免費
Windows 軟件下載
系統軟件
辦公軟件
圖像處理
影音媒體
網絡軟件
應用軟件
Mac 軟件下載
安卓軟件下載
網絡資訊
Mac資訊
Linux資訊
VPS資訊
NASA資訊
WordPress資訊
WeChat資訊
PHP資訊
教學資源
開源程序
網頁工具
SEO工具
醫療健康
其他資訊
Content from
Content to
2021 年 6 月
一 二 三 四 五 六 日
 123456
78910111213
14151617181920
21222324252627
282930  
« 5 月   7 月 »

分類

  • 網站公告
  • 限時免費
  • Windows 軟件下載
  • 系統軟件
  • 辦公軟件
  • 圖像處理
  • 影音媒體
  • 網絡軟件
  • 應用軟件
  • Mac 軟件下載
  • 安卓軟件下載
  • 網絡資訊
  • Mac資訊
  • Linux資訊
  • VPS資訊
  • NASA資訊
  • WordPress資訊
  • WeChat資訊
  • PHP資訊
  • 教學資源
  • 開源程序
  • 網頁工具
  • SEO工具
  • 醫療健康
  • 其他資訊

彙整

近期文章

  • 索尼又鎖區過百國家無法遊玩《星刃》 2025-05-16
  • 育碧將下架多款經典遊戲公司稱其有權這麼做 2025-05-16
  • 川普急簽中東AI大單惹惱對華強硬派 2025-05-16
  • 美教授AI講義漏洞百出大學生怒討8000美元學費 2025-05-16
  • 奧特曼嘲諷馬斯克AI翻車:追求真相的AI卻在輸出陰謀論 2025-05-16
  • 東南亞人群基因體研究領域取得里程碑突破 2025-05-16
  • 雷軍最新演講曝光:一場意外給小米帶來巨大質疑不再是產業新人 2025-05-16
  • “中東矽谷”?美國、阿聯酋宣布將聯手打造5吉瓦超級AI園區 2025-05-16
  • Google One訂閱服務的用戶數量達1.5億 2025-05-16
  • 巴菲特第一季大幅減持銀行股蘋果仍是最大重倉股 2025-05-16

熱門文章與頁面︰

  • 您可以在Windows 11 24H2 中找回WordPad
  • 川普希望蘋果停止將iPhone生產轉移到印度轉而提高美國產量
  • 科學家發現人類能發出的微弱的可見光但死後會消失
  • AI破解遠古密碼:消失百萬年的巨型蜥蜴曾稱霸北美
  • 打車叫到特斯拉不會開門很尷尬?官方介紹開關門方法
  • “中東矽谷”?美國、阿聯酋宣布將聯手打造5吉瓦超級AI園區
  • 印度批准蘋果供應商富士康4.33億美元晶片合資項目
  • 全球最大汽車運輸船入列一次能拉9500台
  • 星巴克據悉考慮出售中國業務股份正與私募及科技領域公司接觸
  • 東京電玩展2025主視覺圖正式公開主題“玩無止境”

投遞稿件

歡迎各界人士投遞稿件到admin@wongcw.com

請提供以下資料:

1.你的名字

2.你的電郵

3.分類目錄

4.文章標題

5.文章摘要

6.文章內容

7.文章來源

 

聯繫我們

查詢,投稿,商務合作:
​admin@wongcw.com
​技術支援:
​support@wongcw.com
​客户服務:
​cs@wongcw.com

QQ群:833641851

快帆

MALUS

極度掃描

DMCA.com Protection Status

WONGCW 網誌

  • 免責聲明
  • 捐助我們
  • ThemeNcode PDF Viewer
  • ThemeNcode PDF Viewer SC
  • Events

服務器提供

本站使用之服務器由ikoula提供。

聯繫我們

查詢,投稿,商務合作:
​admin@wongcw.com
​技術支援:
​support@wongcw.com
​客户服務:
​cs@wongcw.com

QQ群:833641851

© 2025   All Rights Reserved.