In[]:=
FLACMetaInformation[file_]:=Module[{marker,bitArray,lastMetadataBlockFlag,metadataBlockType,metadataBlockLength,minimumBlockSize,maximumBlockSize,minimumFrameSize,maximumFrameSize,sampleRate,audioChannels,sampleDepth,length,md5Signature,applicationID,applicationData,vendorLength,vendor,userCommentListLength,userCommentList,userCommentLength,userComment,result},Quiet[Close[file]];(*theFLACstreammarker*)marker=StringJoin[BinaryRead[file,ConstantArray["Character8",4]]];If[marker!="fLaC",Close[file];Return[$Failed]];(*MetadataBlock*)result=Reap[Do[bitArray=IntegerDigits[BinaryRead[file],2,8];lastMetadataBlockFlag=bitArray[[1]];metadataBlockType=FromDigits[bitArray[[2;;8]],2];metadataBlockLength=FromDigits[BinaryRead[file,ConstantArray["Byte",3]],256];Sow[Switch[metadataBlockType,(*StreamInformation*)0,minimumBlockSize=FromDigits[BinaryRead[file,ConstantArray["Byte",2]],256];maximumBlockSize=FromDigits[BinaryRead[file,ConstantArray["Byte",2]],256];minimumFrameSize=FromDigits[BinaryRead[file,ConstantArray["Byte",3]],256];maximumFrameSize=FromDigits[BinaryRead[file,ConstantArray["Byte",3]],256];bitArray=Join@@IntegerDigits[BinaryRead[file,ConstantArray["Byte",8]],2,8];sampleRate=FromDigits[bitArray[[1;;20]],2];audioChannels=FromDigits[bitArray[[21;;23]],2]+1;sampleDepth=FromDigits[bitArray[[24;;28]],2]+1;length=FromDigits[bitArray[[29;;64]],2];md5Signature=StringJoin@@IntegerString[BinaryRead[file,ConstantArray["Byte",16]],16];<|"StreamInformation"-><|"MinimumBlockSize"->minimumBlockSize,"MaximumBlockSize"->maximumBlockSize,"MinimumFrameSize"->minimumFrameSize,"MaximumFrameSize"->maximumFrameSize,"SampleRate"->sampleRate,"AudioChannels"->audioChannels,"SampleDepth"->sampleDepth,"Length"->length,"MD5Signature"->md5Signature|>|>,(*Padding*)1,BinaryRead[file,ConstantArray["Byte",metadataBlockLength]];Nothing,(*Application*)2,applicationID=FromCharacterCode[BinaryRead[file,ConstantArray["Byte",4]],"UTF-8"];applicationData=FromCharacterCode[BinaryRead[file,ConstantArray["Byte",metadataBlockLength-4]],"UTF-8"];<|"Application"-><|"ApplicationID"->applicationID,"ApplicationData"->applicationData|>|>,(*SeekTable*)3,<|"SeekTable"->(BinaryRead[file,ConstantArray["Byte",metadataBlockLength]];"I'm lazy...")|>,(*VorbisComment*)4,vendorLength=BinaryRead[file,"UnsignedInteger32"];vendor=FromCharacterCode[BinaryRead[file,ConstantArray["Byte",vendorLength]],"UTF-8"];userCommentListLength=BinaryRead[file,"UnsignedInteger32"];userCommentList=Table[userCommentLength=BinaryRead[file,"UnsignedInteger32"];userComment=StringSplit[FromCharacterCode[BinaryRead[file,ConstantArray["Byte",userCommentLength]],"UTF-8"],"=",2],{i,1,userCommentListLength}];<|"VorbisComment"-><|"Vendor"->vendor,"UserComment"-><|Rule@@@userCommentList|>|>|>,5,<|"CueSheet"->BinaryRead[file,ConstantArray["Byte",metadataBlockLength]]|>,6,<|"Picture"->(BinaryRead[file,ConstantArray["Byte",metadataBlockLength]];"I'm lazy...")|>,_?(LessEqual[7,#,126]&),<|"Reserved"<>ToString[n]->(BinaryRead[file,ConstantArray["Byte",metadataBlockLength]];"I'm lazy...")|>,127,Close[file];Return[$Invalid]]];If[lastMetadataBlockFlag==1,Break[]],{n,1,∞}]][[2,1]];Return[<|result|>]];
t=FLACMetaInformation["001-可愛くてごめん.flac"]Dataset[t]
Out[]=
StreamInformationMinimumBlockSize1152,MaximumBlockSize1152,MinimumFrameSize6074,MaximumFrameSize6924,SampleRate48000,AudioChannels2,SampleDepth24,Length10351730,MD5Signatureebd5e2f1ba9f3e5a2317397809ba96,VorbisCommentVendorreference libFLAC 1.3.1 20141125,UserCommentARTISTアーリャ(CV:上坂すみれ),TITLE可愛くてごめん,ALBUMTVアニメ「時々ボソッとロシア語でデレる隣のアーリャさん」エンディングテーマ「可愛くてごめん」,ALBUMARTISTアーリャ(CV:上坂すみれ),GENRE ,GENRENUMBER ,DATE,COMPOSERshito,DISCNUMBER1,TRACKNUMBER1,COPYRIGHT2024 KADOKAWA CORPORATION,ORGANIZATIONJASRAC / KADOKAWA,COMMENTJASRAC / KADOKAWA,PERFORMER ,MOOD ,45b1d925-1448-5784-b4da-b89901050a1310006001,be242671-3d48-5ac8-b762-7d2db4f584b834094288,ff8ca75f-2d68-52eb-85d6-1580486025a498824148,93a74bea-ce97-5571-a56a-c5084dba9873JPD732400953,8e90f26b-372a-5c8c-bb05-1ec0f36ee60c20475762,07f42305-3c75-529c-ba48-09435e88980d ,50dbf5a2-f864-5c17-be00-c36dfd3df7b4 ,PictureI'm lazy...
Out[]=