Win10竟會(huì)損壞用戶(hù)文件!可通過(guò)Windows Update升級(jí)KB5003214補(bǔ)丁進(jìn)行修
如果你是一名音樂(lè)發(fā)燒友,那么應(yīng)該知道Flac這種常見(jiàn)的無(wú)損音樂(lè)格式。Flac音樂(lè)文件支持metadata,用戶(hù)可以編輯metadata,讓音樂(lè)文件帶有藝術(shù)家、所屬專(zhuān)輯、音軌等等信息。
通常來(lái)說(shuō),metadata和音頻數(shù)據(jù)并不相關(guān),修改metadata并不會(huì)影響音頻本身。
但是,近日微軟官方公布了Win10中存在一個(gè)Bug,在Win10中用資源管理器修改Flac文件的metadata,竟會(huì)導(dǎo)致音頻的損壞!
根據(jù)Windows Latest的報(bào)道,微軟最新發(fā)布的一份支持文件披露,如果在Win10的2004或者更高版本中,使用文件資源管理器修改Flac音樂(lè)文件的metadata,就會(huì)損耗Flac音頻文件。
這個(gè)Bug在Win10專(zhuān)業(yè)版、家庭版、企業(yè)版、工作站版乃至其他版本的Win10中均有出現(xiàn)。
根據(jù)微軟本月早些時(shí)候發(fā)布的支持文件,Win10的文件資源管理器導(dǎo)致了這個(gè)錯(cuò)誤,它破壞了Flac文件頭包含的ID3框架也就是metadata,而這個(gè)ID3框架負(fù)責(zé)存儲(chǔ)音頻的注釋?zhuān)缫魳?lè)標(biāo)題、藝術(shù)家、專(zhuān)輯、曲目編號(hào)等。
在Win10上,F(xiàn)lac的處理程序忽視了ID3框架,該程序認(rèn)為Flac文件在使用4字節(jié)的文件頭,當(dāng)Flac文件被Win10編輯的時(shí)候,ID3框架被覆蓋了,導(dǎo)致沒(méi)有了開(kāi)始代碼,導(dǎo)致了音樂(lè)播放器無(wú)法識(shí)別被修改后的文件。
因此,在Win10中,如果你直接用文件資源管理器修改Flac音樂(lè)文件的標(biāo)題、藝術(shù)家等metadata,會(huì)導(dǎo)致該文件無(wú)法播放。
幸運(yùn)的是,微軟已經(jīng)確定了Bug的根本原因,用戶(hù)可以通過(guò)Windows Update升級(jí)KB5003214補(bǔ)丁進(jìn)行修復(fù)。
在KB5003214補(bǔ)丁中,微軟確認(rèn)了上文提到的錯(cuò)誤已經(jīng)被修復(fù),修改了Flac的標(biāo)題、藝術(shù)家等metadata后,F(xiàn)lac不會(huì)再變得無(wú)法播放。
而對(duì)于已經(jīng)損壞了的Flac文件,微軟則發(fā)布了一個(gè)PowerShell腳本來(lái)進(jìn)行修復(fù),運(yùn)行該腳本后Flac文件即可重新播放,不過(guò)已經(jīng)從ID3框架中丟失了的metadata信息并不能恢復(fù)。
下面是利用PowerShell腳本修復(fù)Flac文件的具體方法。
1、開(kāi)啟記事本;
2、復(fù)制以下字符,粘貼到記事本中:
# 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)
$stream.Close()
$fixedStream.Close()
Move-Item -Force "$FullPath.tmp" $FullPath
}
3、保存文件,在“另存為”對(duì)話(huà)框中,將目錄定位到你想要保存PowerShell腳本的位置;
4、在文件名輸入框中,輸入“FixFlacFiles.ps1”,將另存為文件的類(lèi)型更改為T(mén)ext Documents (*.txt);
5、進(jìn)入到你保存該P(yáng)owerShell腳本的目錄;
6、右鍵點(diǎn)擊剛剛保存的腳本,然后選擇“使用PowerShell運(yùn)行”;
7、出現(xiàn)提示時(shí),輸入無(wú)法播放的Flac文件的文件名,然后按下回車(chē)鍵。
微軟建議大家安裝本月推送的可選累積更新,以避免修改Flac文件metadata出現(xiàn)的問(wèn)題。
標(biāo)簽: Win10 損壞用戶(hù)文件 Bug 無(wú)損音樂(lè)格式
2022-01-12 16:50:28
2022-01-12 14:16:53
2022-01-12 09:59:21
2022-01-12 08:30:09
2022-01-12 08:28:09
2022-01-12 08:26:11
2022-01-12 08:24:25
2022-01-12 08:22:56
2022-01-12 08:21:28
2022-01-12 08:19:22
2022-01-12 08:15:03
2022-01-12 08:13:37
2022-01-12 08:12:23
2022-01-11 16:27:40
2022-01-11 12:02:31 熱門(mén)文章
- 1消息稱(chēng)Win11調(diào)整硬件安裝需求之后可運(yùn)行5.25寸軟盤(pán)
- 2蘋(píng)果iPad mini 6屏幕刷新率只有60Hz屏幕或不能滿(mǎn)足游戲需求
- 3三星永久關(guān)閉Tizen應(yīng)用商店:目前相關(guān)手機(jī)用戶(hù)已經(jīng)無(wú)法訪(fǎng)問(wèn)
- 4三星Galaxy S22 Ultra手寫(xiě)筆延遲突破2.8毫秒!成品預(yù)計(jì)今年2月推出
- 5Win11照片應(yīng)用迎來(lái)更新:重新優(yōu)化調(diào)整圖片編輯功能
- 6Chrome 97正式版預(yù)計(jì)年內(nèi)2月1日轉(zhuǎn)正 修復(fù)數(shù)十個(gè)安全BUG
- 7消息稱(chēng)iPhone 14 Pro前置攝像頭將采用藥丸屏設(shè)計(jì) FaceID轉(zhuǎn)移到顯示屏下
- 8對(duì)不起,我恐怕不能這么做?用戶(hù)發(fā)現(xiàn)蘋(píng)果Siri無(wú)法為Apple Music歌曲評(píng)分
- 9微信視頻號(hào)直播推出扶持不少于10萬(wàn)個(gè)優(yōu)質(zhì)商家激勵(lì)計(jì)劃 引導(dǎo)私域用戶(hù)直播
- 10微信支持?jǐn)?shù)字人民幣支付:將新增“使用數(shù)字人民幣付款”選項(xiàng)
熱點(diǎn)專(zhuān)題
-
絕版旗艦堅(jiān)果R2獲更新:TNT連...1月7日消息,堅(jiān)果R2用戶(hù)在百度貼吧反映,堅(jiān)果R2手機(jī)獲得了SmartisanOS更新,版本號(hào)為8 5 1,新版系統(tǒng)... -
iPhone 13 Pro需求產(chǎn)能供不...富士康鄭州工廠(chǎng)又在招工了,iPhone的產(chǎn)能缺口看來(lái)很大。據(jù)悉,iPhone 13 Pro需求旺盛,最大組裝廠(chǎng)富士... -
百度投資生物醫(yī)藥公司瑞順生...企查查APP顯示,1月4日,廣東瑞順生物技術(shù)有限公司發(fā)生工商變更,新增百度關(guān)聯(lián)公司三亞百川致新私募股權(quán)... -
盜版軟件Popcorn Time宣布關(guān)...1月5日 消息:盜版軟件Popcorn Time宣布關(guān)閉了。這個(gè)通過(guò)盜版BitTorrent資源向用戶(hù)傳遞電影內(nèi)容,并承... -
快手12月份打擊私單交易等詐...1月5日消息,日前,快手發(fā)布了最新一期關(guān)于嚴(yán)厲打擊詐騙類(lèi)帳號(hào)的公告,該平臺(tái) 12 月份共處罰詐騙類(lèi)帳... -
再也不怕磁盤(pán)占用高了!微軟W...微軟的Office辦公軟件是每個(gè)打工人幾乎都離不開(kāi)的,它實(shí)際上是包括Word、Excel、PPT等多種軟件在內(nèi)的全... -
黑莓BlackBerry OS停止運(yùn)行...1月4日,黑莓打造的BlackBerry OS停服。官方稱(chēng),黑莓不再提供適用于BlackBerry7 1OS及更早版本、Black... -
Intel預(yù)熱12代雞血版i9-12900...今天晚上,Intel將會(huì)發(fā)布12代酷睿桌面版非K系列、移動(dòng)版,應(yīng)該會(huì)有博銳商務(wù)版,以及一個(gè)特殊型號(hào):i9-12... -
曝5G版iPhone SE將于上半年...除了挖孔屏iPhone 14、M2處理器MacBook Air、40核CPU+128核GPU的Mac Pro等產(chǎn)品,蘋(píng)果名記Mark Gurma... -
曝iPhone 14有望取消劉海設(shè)...對(duì)于iPhone 14來(lái)說(shuō),按照蘋(píng)果一貫的更新節(jié)奏看,這一代新機(jī)的外形要發(fā)生變化了,而去掉劉海,改用打孔...
Copy 2006-2020 財(cái)訊中國(guó) 版權(quán)所有<豫ICP備17019456號(hào)-9
聯(lián)系網(wǎng)站:52 78 229 @qq.com
營(yíng)業(yè)執(zhí)照公示信息
聲明:本站所有文章、數(shù)據(jù)僅供參考,使用前務(wù)請(qǐng)仔細(xì)閱讀法律聲明,風(fēng)險(xiǎn)自負(fù)。

相關(guān)新聞