Compare commits
4 commits
a14254bd2e
...
6c0ca775cd
Author | SHA1 | Date | |
---|---|---|---|
|
6c0ca775cd | ||
|
f05aada52d | ||
|
aebc52880b | ||
|
e8a7eaf954 |
63 changed files with 2337 additions and 1266 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -36,7 +36,7 @@ Xcode-config/SENTRY_SETTINGS.xcconfig
|
|||
/ThirdParty/ffmpeg/lib/libavformat.61.dylib
|
||||
/ThirdParty/ffmpeg/lib/libavutil.59.dylib
|
||||
/ThirdParty/ffmpeg/lib/libswresample.5.dylib
|
||||
/ThirdParty/flac/lib/libFLAC.12.dylib
|
||||
/ThirdParty/flac/lib/libFLAC.14.dylib
|
||||
/ThirdParty/libid3tag/lib/libid3tag.a
|
||||
/ThirdParty/libmad/lib/libmad.a
|
||||
/ThirdParty/libopenmpt/lib/libopenmpt.a
|
||||
|
|
|
@ -129,7 +129,7 @@
|
|||
836EF0C827BB91E600BF35B2 /* libogg.0.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 836EF0C427BB919300BF35B2 /* libogg.0.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
|
||||
836EF0C927BB91E900BF35B2 /* libvorbisfile.3.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 836EF0C627BB91AB00BF35B2 /* libvorbisfile.3.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
|
||||
836EF0CA27BB91EB00BF35B2 /* libvorbis.0.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 836EF0C527BB91AB00BF35B2 /* libvorbis.0.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
|
||||
836EF0CB27BB91EE00BF35B2 /* libFLAC.12.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 836EF0C727BB91BC00BF35B2 /* libFLAC.12.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
|
||||
836EF0CB27BB91EE00BF35B2 /* libFLAC.14.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 836EF0C727BB91BC00BF35B2 /* libFLAC.14.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
|
||||
836EF0E027BB98A800BF35B2 /* libopus.0.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 836EF0CC27BB94E100BF35B2 /* libopus.0.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
|
||||
836EF0E127BB98AB00BF35B2 /* libopusfile.0.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 836EF0CD27BB94F100BF35B2 /* libopusfile.0.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
|
||||
836F5BF91A357A01002730CC /* sidplay.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8314D6411A354DFF00EEE8E6 /* sidplay.bundle */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
|
@ -721,7 +721,7 @@
|
|||
836DF617298F6F1700CD0580 /* libsoxr.0.dylib in CopyFiles */,
|
||||
836EF0E127BB98AB00BF35B2 /* libopusfile.0.dylib in CopyFiles */,
|
||||
836EF0E027BB98A800BF35B2 /* libopus.0.dylib in CopyFiles */,
|
||||
836EF0CB27BB91EE00BF35B2 /* libFLAC.12.dylib in CopyFiles */,
|
||||
836EF0CB27BB91EE00BF35B2 /* libFLAC.14.dylib in CopyFiles */,
|
||||
836EF0CA27BB91EB00BF35B2 /* libvorbis.0.dylib in CopyFiles */,
|
||||
83256B69286661FC0036D9C0 /* libmpg123.0.dylib in CopyFiles */,
|
||||
836EF0C927BB91E900BF35B2 /* libvorbisfile.3.dylib in CopyFiles */,
|
||||
|
@ -951,7 +951,7 @@
|
|||
836EF0C427BB919300BF35B2 /* libogg.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libogg.0.dylib; path = ThirdParty/ogg/lib/libogg.0.dylib; sourceTree = "<group>"; };
|
||||
836EF0C527BB91AB00BF35B2 /* libvorbis.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libvorbis.0.dylib; path = ThirdParty/vorbis/lib/libvorbis.0.dylib; sourceTree = "<group>"; };
|
||||
836EF0C627BB91AB00BF35B2 /* libvorbisfile.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libvorbisfile.3.dylib; path = ThirdParty/vorbis/lib/libvorbisfile.3.dylib; sourceTree = "<group>"; };
|
||||
836EF0C727BB91BC00BF35B2 /* libFLAC.12.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libFLAC.12.dylib; path = ThirdParty/flac/lib/libFLAC.12.dylib; sourceTree = "<group>"; };
|
||||
836EF0C727BB91BC00BF35B2 /* libFLAC.14.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libFLAC.14.dylib; path = ThirdParty/flac/lib/libFLAC.14.dylib; sourceTree = "<group>"; };
|
||||
836EF0CC27BB94E100BF35B2 /* libopus.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libopus.0.dylib; path = ThirdParty/opus/lib/libopus.0.dylib; sourceTree = "<group>"; };
|
||||
836EF0CD27BB94F100BF35B2 /* libopusfile.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libopusfile.0.dylib; path = ThirdParty/opusfile/lib/libopusfile.0.dylib; sourceTree = "<group>"; };
|
||||
836F6B2518BDB80D0095E648 /* vgmstream.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = vgmstream.xcodeproj; path = Plugins/vgmstream/vgmstream.xcodeproj; sourceTree = "<group>"; };
|
||||
|
@ -1154,7 +1154,7 @@
|
|||
835FAC7D27BCDF5B00BA8562 /* libavif.a */,
|
||||
836EF0CD27BB94F100BF35B2 /* libopusfile.0.dylib */,
|
||||
836EF0CC27BB94E100BF35B2 /* libopus.0.dylib */,
|
||||
836EF0C727BB91BC00BF35B2 /* libFLAC.12.dylib */,
|
||||
836EF0C727BB91BC00BF35B2 /* libFLAC.14.dylib */,
|
||||
836EF0C527BB91AB00BF35B2 /* libvorbis.0.dylib */,
|
||||
836EF0C627BB91AB00BF35B2 /* libvorbisfile.3.dylib */,
|
||||
836EF0C427BB919300BF35B2 /* libogg.0.dylib */,
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
8306B0EB20984590000302D4 /* wave_segmented.c in Sources */ = {isa = PBXBuildFile; fileRef = 8306B0D02098458F000302D4 /* wave_segmented.c */; };
|
||||
8306B0EC20984590000302D4 /* pcm_sre.c in Sources */ = {isa = PBXBuildFile; fileRef = 8306B0D12098458F000302D4 /* pcm_sre.c */; };
|
||||
8306B0ED20984590000302D4 /* txtp.c in Sources */ = {isa = PBXBuildFile; fileRef = 8306B0D22098458F000302D4 /* txtp.c */; };
|
||||
8306B0EE20984590000302D4 /* smc_smh.c in Sources */ = {isa = PBXBuildFile; fileRef = 8306B0D32098458F000302D4 /* smc_smh.c */; };
|
||||
8306B0EE20984590000302D4 /* smh_smc.c in Sources */ = {isa = PBXBuildFile; fileRef = 8306B0D32098458F000302D4 /* smh_smc.c */; };
|
||||
8306B0EF20984590000302D4 /* ubi_bao.c in Sources */ = {isa = PBXBuildFile; fileRef = 8306B0D420984590000302D4 /* ubi_bao.c */; };
|
||||
8306B0F020984590000302D4 /* atsl.c in Sources */ = {isa = PBXBuildFile; fileRef = 8306B0D520984590000302D4 /* atsl.c */; };
|
||||
8306B0F120984590000302D4 /* ppst.c in Sources */ = {isa = PBXBuildFile; fileRef = 8306B0D620984590000302D4 /* ppst.c */; };
|
||||
|
@ -154,6 +154,8 @@
|
|||
832BF82B21E0514B006F50F1 /* xopus.c in Sources */ = {isa = PBXBuildFile; fileRef = 832BF81921E0514A006F50F1 /* xopus.c */; };
|
||||
832BF82C21E0514B006F50F1 /* hca_keys_awb.h in Headers */ = {isa = PBXBuildFile; fileRef = 832BF81A21E0514A006F50F1 /* hca_keys_awb.h */; };
|
||||
832BF82D21E0514B006F50F1 /* nus3audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 832BF81B21E0514B006F50F1 /* nus3audio.c */; };
|
||||
832F9EA62E29047F00D08728 /* srcd.c in Sources */ = {isa = PBXBuildFile; fileRef = 832F9EA52E29047F00D08728 /* srcd.c */; };
|
||||
832F9EA82E2905D500D08728 /* mhwk.c in Sources */ = {isa = PBXBuildFile; fileRef = 832F9EA72E2905D500D08728 /* mhwk.c */; };
|
||||
832FC36C278FA4CB0056A860 /* ubi_ckd_cwav_streamfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 832FC367278FA4CB0056A860 /* ubi_ckd_cwav_streamfile.h */; };
|
||||
832FC36D278FA4CB0056A860 /* ubi_ckd_cwav.c in Sources */ = {isa = PBXBuildFile; fileRef = 832FC36B278FA4CB0056A860 /* ubi_ckd_cwav.c */; };
|
||||
832FC36F278FAE3E0056A860 /* encrypted_mc161_streamfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 832FC36E278FAE3E0056A860 /* encrypted_mc161_streamfile.h */; };
|
||||
|
@ -515,7 +517,7 @@
|
|||
836F6F9418BDC2190095E648 /* iivb.c in Sources */ = {isa = PBXBuildFile; fileRef = 836F6E5818BDC2180095E648 /* iivb.c */; };
|
||||
836F6F9518BDC2190095E648 /* kraw.c in Sources */ = {isa = PBXBuildFile; fileRef = 836F6E5918BDC2180095E648 /* kraw.c */; };
|
||||
836F6F9618BDC2190095E648 /* lsf.c in Sources */ = {isa = PBXBuildFile; fileRef = 836F6E5A18BDC2180095E648 /* lsf.c */; };
|
||||
836F6F9818BDC2190095E648 /* mattel_hyperscan.c in Sources */ = {isa = PBXBuildFile; fileRef = 836F6E5C18BDC2180095E648 /* mattel_hyperscan.c */; };
|
||||
836F6F9818BDC2190095E648 /* kvag.c in Sources */ = {isa = PBXBuildFile; fileRef = 836F6E5C18BDC2180095E648 /* kvag.c */; };
|
||||
836F6F9918BDC2190095E648 /* maxis_xa.c in Sources */ = {isa = PBXBuildFile; fileRef = 836F6E5D18BDC2180095E648 /* maxis_xa.c */; };
|
||||
836F6F9A18BDC2190095E648 /* meta.h in Headers */ = {isa = PBXBuildFile; fileRef = 836F6E5E18BDC2180095E648 /* meta.h */; };
|
||||
836F6F9C18BDC2190095E648 /* mp4.c in Sources */ = {isa = PBXBuildFile; fileRef = 836F6E6018BDC2180095E648 /* mp4.c */; };
|
||||
|
@ -1020,7 +1022,7 @@
|
|||
8306B0D02098458F000302D4 /* wave_segmented.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = wave_segmented.c; sourceTree = "<group>"; };
|
||||
8306B0D12098458F000302D4 /* pcm_sre.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pcm_sre.c; sourceTree = "<group>"; };
|
||||
8306B0D22098458F000302D4 /* txtp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = txtp.c; sourceTree = "<group>"; };
|
||||
8306B0D32098458F000302D4 /* smc_smh.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = smc_smh.c; sourceTree = "<group>"; };
|
||||
8306B0D32098458F000302D4 /* smh_smc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = smh_smc.c; sourceTree = "<group>"; };
|
||||
8306B0D420984590000302D4 /* ubi_bao.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ubi_bao.c; sourceTree = "<group>"; };
|
||||
8306B0D520984590000302D4 /* atsl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = atsl.c; sourceTree = "<group>"; };
|
||||
8306B0D620984590000302D4 /* ppst.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ppst.c; sourceTree = "<group>"; };
|
||||
|
@ -1112,6 +1114,8 @@
|
|||
832BF81921E0514A006F50F1 /* xopus.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xopus.c; sourceTree = "<group>"; };
|
||||
832BF81A21E0514A006F50F1 /* hca_keys_awb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hca_keys_awb.h; sourceTree = "<group>"; };
|
||||
832BF81B21E0514B006F50F1 /* nus3audio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nus3audio.c; sourceTree = "<group>"; };
|
||||
832F9EA52E29047F00D08728 /* srcd.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = srcd.c; sourceTree = "<group>"; };
|
||||
832F9EA72E2905D500D08728 /* mhwk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = mhwk.c; sourceTree = "<group>"; };
|
||||
832FC367278FA4CB0056A860 /* ubi_ckd_cwav_streamfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ubi_ckd_cwav_streamfile.h; sourceTree = "<group>"; };
|
||||
832FC36B278FA4CB0056A860 /* ubi_ckd_cwav.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ubi_ckd_cwav.c; sourceTree = "<group>"; };
|
||||
832FC36E278FAE3E0056A860 /* encrypted_mc161_streamfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = encrypted_mc161_streamfile.h; sourceTree = "<group>"; };
|
||||
|
@ -1473,7 +1477,7 @@
|
|||
836F6E5818BDC2180095E648 /* iivb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = iivb.c; sourceTree = "<group>"; };
|
||||
836F6E5918BDC2180095E648 /* kraw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = kraw.c; sourceTree = "<group>"; };
|
||||
836F6E5A18BDC2180095E648 /* lsf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lsf.c; sourceTree = "<group>"; };
|
||||
836F6E5C18BDC2180095E648 /* mattel_hyperscan.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mattel_hyperscan.c; sourceTree = "<group>"; };
|
||||
836F6E5C18BDC2180095E648 /* kvag.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = kvag.c; sourceTree = "<group>"; };
|
||||
836F6E5D18BDC2180095E648 /* maxis_xa.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = maxis_xa.c; sourceTree = "<group>"; };
|
||||
836F6E5E18BDC2180095E648 /* meta.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = meta.h; sourceTree = "<group>"; };
|
||||
836F6E6018BDC2180095E648 /* mp4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mp4.c; sourceTree = "<group>"; };
|
||||
|
@ -2498,6 +2502,7 @@
|
|||
83D20074248DDB760048BD24 /* ktsr.c */,
|
||||
834F7CFE2C7085EA003AC386 /* ktsr_streamfile.h */,
|
||||
830EBE122004656E0023AA10 /* ktss.c */,
|
||||
836F6E5C18BDC2180095E648 /* kvag.c */,
|
||||
8373342423F60CDB00DE14DC /* kwb.c */,
|
||||
835B9B8C2730BF2C00F87EE3 /* lopu_fb.c */,
|
||||
836F6E9918BDC2180095E648 /* lp_ap_lep.c */,
|
||||
|
@ -2509,11 +2514,11 @@
|
|||
8373341F23F60CDB00DE14DC /* lrmd_streamfile.h */,
|
||||
836F6E5A18BDC2180095E648 /* lsf.c */,
|
||||
83EDE5D61A70951A005F5D84 /* madp.c */,
|
||||
836F6E5C18BDC2180095E648 /* mattel_hyperscan.c */,
|
||||
836F6E5D18BDC2180095E648 /* maxis_xa.c */,
|
||||
836F6E9D18BDC2180095E648 /* mcg.c */,
|
||||
83709E011ECBC1A4005C03D3 /* mcss.c */,
|
||||
836F6E5E18BDC2180095E648 /* meta.h */,
|
||||
832F9EA72E2905D500D08728 /* mhwk.c */,
|
||||
834FE0DE215C79EB000A5D3D /* mib_mih.c */,
|
||||
836F6EAC18BDC2180095E648 /* mic_koei.c */,
|
||||
83B73C4A2D8FF19800A57F08 /* mio.c */,
|
||||
|
@ -2660,7 +2665,7 @@
|
|||
83CBF5422D46339200AA2D75 /* skex.c */,
|
||||
836F6EBB18BDC2180095E648 /* sl3.c */,
|
||||
836F6EF218BDC2190095E648 /* sli.c */,
|
||||
8306B0D32098458F000302D4 /* smc_smh.c */,
|
||||
8306B0D32098458F000302D4 /* smh_smc.c */,
|
||||
837CEAEB23487F2B00E62A4A /* smk.c */,
|
||||
83F0AA5C21E2028B004BBC04 /* smp.c */,
|
||||
836F6EBC18BDC2180095E648 /* smpl.c */,
|
||||
|
@ -2679,6 +2684,7 @@
|
|||
83A21F84201D8981000F04B9 /* sqex_sead.c */,
|
||||
837CEAF023487F2C00E62A4A /* sqex_streamfile.h */,
|
||||
83C0C75C2AA435C60056AFD8 /* squeak.c */,
|
||||
832F9EA52E29047F00D08728 /* srcd.c */,
|
||||
834FE0D6215C79E9000A5D3D /* sscf.c */,
|
||||
8396BE792935FC2F00CD0580 /* sscf_encrypted.h */,
|
||||
8396BE782935FC2F00CD0580 /* sscf_encrypted.c */,
|
||||
|
@ -3245,7 +3251,7 @@
|
|||
83A21F8D201D8982000F04B9 /* sqex_sead.c in Sources */,
|
||||
834F7ED32C70A786003AC386 /* mixing.c in Sources */,
|
||||
83EED5D3203A8BC7008BEB45 /* ea_swvr.c in Sources */,
|
||||
8306B0EE20984590000302D4 /* smc_smh.c in Sources */,
|
||||
8306B0EE20984590000302D4 /* smh_smc.c in Sources */,
|
||||
834F7DAB2C7093EA003AC386 /* asf_decoder.c in Sources */,
|
||||
834F7E0C2C7093EA003AC386 /* ws_decoder.c in Sources */,
|
||||
834F7EDB2C70A786003AC386 /* streamfile_api.c in Sources */,
|
||||
|
@ -3553,7 +3559,7 @@
|
|||
834F7E962C70A45C003AC386 /* txtp_parser.c in Sources */,
|
||||
834FE0EA215C79ED000A5D3D /* aif_asobo.c in Sources */,
|
||||
836F700418BDC2190095E648 /* vas_kceo.c in Sources */,
|
||||
836F6F9818BDC2190095E648 /* mattel_hyperscan.c in Sources */,
|
||||
836F6F9818BDC2190095E648 /* kvag.c in Sources */,
|
||||
8306B0BA20984552000302D4 /* blocked_wsi.c in Sources */,
|
||||
834F7E802C709EA0003AC386 /* adp_ongakukan.c in Sources */,
|
||||
83BAFB6C19F45EB3005DAB60 /* bfstm.c in Sources */,
|
||||
|
@ -3667,6 +3673,7 @@
|
|||
834F7DB62C7093EA003AC386 /* compresswave_lib.c in Sources */,
|
||||
834F7E042C7093EA003AC386 /* vorbis_custom_utils_awc.c in Sources */,
|
||||
8306B0EC20984590000302D4 /* pcm_sre.c in Sources */,
|
||||
832F9EA62E29047F00D08728 /* srcd.c in Sources */,
|
||||
836F6FC818BDC2190095E648 /* pos.c in Sources */,
|
||||
836F6F8918BDC2190095E648 /* gca.c in Sources */,
|
||||
836F6FA418BDC2190095E648 /* nds_hwas.c in Sources */,
|
||||
|
@ -3805,6 +3812,7 @@
|
|||
836F6FA918BDC2190095E648 /* ngc_adpdtk.c in Sources */,
|
||||
836F6FDC18BDC2190095E648 /* iab.c in Sources */,
|
||||
83C7282122BC893D00678B4A /* msf_konami.c in Sources */,
|
||||
832F9EA82E2905D500D08728 /* mhwk.c in Sources */,
|
||||
833E82F72A2858EF00CD0580 /* reader.c in Sources */,
|
||||
83B69B222845A26600D2435A /* bw_mp3_riff.c in Sources */,
|
||||
834F7E192C709A1D003AC386 /* ea_schl_abk.c in Sources */,
|
||||
|
|
|
@ -10,7 +10,6 @@ void decode_tantalus(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspac
|
|||
size_t bytes_per_frame, samples_per_frame;
|
||||
|
||||
int32_t hist1 = stream->adpcm_history1_32;
|
||||
int32_t hist2 = stream->adpcm_history2_32;
|
||||
|
||||
|
||||
/* external interleave (fixed size), mono */
|
||||
|
|
|
@ -347,6 +347,7 @@ static const char* extension_list[] = {
|
|||
"mds",
|
||||
"mdsp",
|
||||
"med",
|
||||
"mhwk",
|
||||
"mjb",
|
||||
"mi4", //fake extension for .mib (renamed, to be removed)
|
||||
"mib",
|
||||
|
@ -536,7 +537,7 @@ static const char* extension_list[] = {
|
|||
"skx",
|
||||
"slb", //txth/reserved [THE Nekomura no Hitobito (PS2)]
|
||||
"sli",
|
||||
"smc",
|
||||
"smh",
|
||||
"smk",
|
||||
"smp",
|
||||
"smv",
|
||||
|
@ -558,6 +559,7 @@ static const char* extension_list[] = {
|
|||
"spsd",
|
||||
"spw",
|
||||
"srsa",
|
||||
"srcd",
|
||||
"ss2",
|
||||
"ssd", //txth/reserved [Zack & Wiki (Wii)]
|
||||
"ssf",
|
||||
|
@ -1253,7 +1255,7 @@ static const meta_info meta_info_list[] = {
|
|||
{meta_LSF_N1NJ4N, "Gizmondo Studios Helsingborg LSF header"},
|
||||
{meta_XWAV, "feelplus XWAV header"},
|
||||
{meta_RAW_SNDS, "PC .snds raw header"},
|
||||
{meta_HYPERSCAN_KVAG, "Mattel Hyperscan KVAG"},
|
||||
{meta_KVAG, "Mattel KVAG header"},
|
||||
{meta_PSND, "Polarbit PSND header"},
|
||||
{meta_ADP_WILDFIRE, "Wildfire ADP! header"},
|
||||
{meta_QD_ADP, "Quantic Dream .ADP header"},
|
||||
|
@ -1479,6 +1481,8 @@ static const meta_info meta_info_list[] = {
|
|||
{meta_AUDIOPKG, "Inevitable .AUDIOPKG header"},
|
||||
{meta_SWAR, "Nintendo SWAR header"},
|
||||
{meta_IVB, "Metro IVB header"},
|
||||
{meta_SRCD, "Capcom SRCD header"},
|
||||
{meta_MHWK, "Broderbund MHWK header"}
|
||||
};
|
||||
|
||||
void get_vgmstream_coding_description(VGMSTREAM* vgmstream, char* out, size_t out_size) {
|
||||
|
|
|
@ -25,13 +25,13 @@ VGMSTREAM* init_vgmstream_astl(STREAMFILE* sf) {
|
|||
// 28: -1?
|
||||
// 2c: -1?
|
||||
|
||||
if (read_u16le(0x30,sf) != 0x0001) // PCM only
|
||||
return NULL;
|
||||
channels = read_u16le(0x32, sf);
|
||||
int sample_rate = read_s32le(0x34,sf);
|
||||
// 38: bitrate
|
||||
// 3a: block size
|
||||
// 3c: bps
|
||||
// fmt-like
|
||||
int format = read_u16le(0x30 + 0x00, sf);
|
||||
channels = read_u16le(0x30 + 0x02, sf);
|
||||
int sample_rate = read_s32le(0x30 + 0x04, sf);
|
||||
// 08: avg bitrate
|
||||
// 0a: block size
|
||||
// 0e: bps
|
||||
|
||||
loop_flag = 0; // unlike X360 no apparent loop info in the files
|
||||
|
||||
|
@ -42,11 +42,51 @@ VGMSTREAM* init_vgmstream_astl(STREAMFILE* sf) {
|
|||
|
||||
vgmstream->meta_type = meta_ASTL;
|
||||
vgmstream->sample_rate = sample_rate;
|
||||
vgmstream->num_samples = pcm16_bytes_to_samples(data_size, channels);
|
||||
|
||||
switch(format) {
|
||||
case 0x0001:
|
||||
vgmstream->num_samples = pcm16_bytes_to_samples(data_size, channels);
|
||||
vgmstream->coding_type = coding_PCM16LE;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x2;
|
||||
break;
|
||||
|
||||
#ifdef VGM_USE_FFMPEG
|
||||
case 0xFFFE: { // WAVEFORMATEXTENSIBLE
|
||||
uint32_t avg_bitrate = read_u32le(0x30 + 0x08, sf);
|
||||
uint16_t block_size = read_u16le(0x30 + 0x0c, sf);
|
||||
uint32_t channel_layout = read_u32le(0x30 + 0x14, sf);
|
||||
// actually a GUID but first 32b matches fmt (0x0162 / STATIC_KSDATAFORMAT_SUBTYPE_WMAUDIO3 only?)
|
||||
uint32_t xwma_format = read_u32le(0x30 + 0x18, sf);
|
||||
|
||||
uint32_t dpds_offset = 0x30 + 0x28;
|
||||
uint32_t dpds_size;
|
||||
uint32_t offset = dpds_offset;
|
||||
// TODO channel layout
|
||||
|
||||
vgmstream->codec_data = init_ffmpeg_xwma(sf, start_offset, data_size, xwma_format, channels, sample_rate, avg_bitrate, block_size);
|
||||
if (!vgmstream->codec_data) goto fail;
|
||||
vgmstream->coding_type = coding_FFmpeg;
|
||||
vgmstream->layout_type = layout_none;
|
||||
|
||||
vgmstream->channel_layout = channel_layout;
|
||||
|
||||
// somehow there is no dpds size, so find last value before null padding
|
||||
while (offset < start_offset) {
|
||||
uint32_t sample = read_u32le(offset, sf);
|
||||
if (sample == 0)
|
||||
break;
|
||||
offset += 0x04;
|
||||
}
|
||||
|
||||
dpds_size = offset - dpds_offset;
|
||||
vgmstream->num_samples = xwma_dpds_get_samples(sf, dpds_offset, dpds_size, channels, false);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!vgmstream_open_stream(vgmstream, sf, start_offset))
|
||||
goto fail;
|
||||
|
|
|
@ -50,11 +50,18 @@ VGMSTREAM* init_vgmstream_fsb5_fev_bank(STREAMFILE* sf) {
|
|||
goto fail;
|
||||
|
||||
switch(chunk_type) {
|
||||
case 0x4C495354: /* "LIST" with "SNDH" (usually v0x28 but also in Fall Guys's BNK_Music_RoundReveal) */
|
||||
if (read_u32be(offset + 0x04, sf) == 0x534E4448) {
|
||||
case 0x4C495354: /* "LIST" */
|
||||
// "SNDH" (usually v0x28 but also in Fall Guys's BNK_Music_RoundReveal)
|
||||
if (read_u32be(offset + 0x04, sf) == get_id32be("SNDH")) {
|
||||
bank_offset = offset + 0x0c;
|
||||
bank_size = read_s32le(offset + 0x08,sf);
|
||||
}
|
||||
|
||||
// multiple CrankcaseAudio REV ADM3 [Rennsport (PC)]
|
||||
if (read_u32be(offset + 0x00, sf) == get_id32be("PEFX")) {
|
||||
bank_offset = offset;
|
||||
bank_size = chunk_size;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x534E4448: /* "SNDH" */
|
||||
|
|
|
@ -1572,6 +1572,9 @@ static const hcakey_info hcakey_list[] = {
|
|||
// Sand Land (multi)
|
||||
{910990237314908160}, // 0CA47CCB51010000
|
||||
|
||||
// Patapon 1 & 2 Reloaded (PC)
|
||||
{3316332033470531258}, // 2E05FA69EC4286BA
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -3,38 +3,39 @@
|
|||
|
||||
|
||||
/* IDSP - from Inevitable Entertainment games [Defender (GC)] */
|
||||
VGMSTREAM * init_vgmstream_idsp_ie(STREAMFILE *streamFile) {
|
||||
VGMSTREAM* init_vgmstream_idsp_ie(STREAMFILE* sf) {
|
||||
VGMSTREAM* vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
int loop_flag, channel_count;
|
||||
int loop_flag, channels;
|
||||
|
||||
|
||||
/* checks */
|
||||
if ( !check_extensions(streamFile,"idsp") )
|
||||
goto fail;
|
||||
if (read_32bitBE(0x00,streamFile) != 0x49445350) /* "IDSP" */
|
||||
goto fail;
|
||||
if (!is_id32be(0x00, sf, "IDSP"))
|
||||
return NULL;
|
||||
if (!check_extensions(sf,"idsp"))
|
||||
return NULL;
|
||||
|
||||
channels = read_s32be(0x0C,sf);
|
||||
if (channels > 2) return NULL;
|
||||
|
||||
loop_flag = 0;
|
||||
channel_count = read_32bitBE(0x0C,streamFile);
|
||||
if (channel_count > 2) goto fail;
|
||||
start_offset = 0x70;
|
||||
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
vgmstream = allocate_vgmstream(channels,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->meta_type = meta_IDSP_IE;
|
||||
vgmstream->sample_rate = read_32bitBE(0x08,streamFile);
|
||||
vgmstream->sample_rate = read_s32be(0x08,sf);
|
||||
vgmstream->coding_type = coding_NGC_DSP;
|
||||
vgmstream->num_samples = dsp_bytes_to_samples(read_32bitBE(0x04,streamFile), channel_count);
|
||||
vgmstream->num_samples = dsp_bytes_to_samples(read_u32be(0x04,sf), channels);
|
||||
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = read_32bitBE(0x10,streamFile);
|
||||
dsp_read_coefs_be(vgmstream,streamFile,0x14,0x2E);
|
||||
vgmstream->interleave_block_size = read_u32be(0x10,sf);
|
||||
dsp_read_coefs_be(vgmstream, sf, 0x14, 0x2E);
|
||||
|
||||
if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) )
|
||||
if (!vgmstream_open_stream(vgmstream, sf, start_offset))
|
||||
goto fail;
|
||||
return vgmstream;
|
||||
|
||||
|
|
|
@ -1,54 +1,52 @@
|
|||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
|
||||
/* .IMC - from iNiS Gitaroo Man (PS2) */
|
||||
VGMSTREAM * init_vgmstream_imc(STREAMFILE *streamFile) {
|
||||
/* .IMC (subfile) - from iNiS Gitaroo Man (PS2) */
|
||||
VGMSTREAM* init_vgmstream_imc(STREAMFILE* sf) {
|
||||
VGMSTREAM* vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
int loop_flag, channel_count, sample_rate, interleave, blocks;
|
||||
size_t file_size, data_size;
|
||||
|
||||
|
||||
/* checks */
|
||||
/* .imc: extension from the main container */
|
||||
if (!check_extensions(streamFile, "imc"))
|
||||
goto fail;
|
||||
if (!check_extensions(sf, "imc"))
|
||||
return NULL;
|
||||
|
||||
channel_count = read_32bitLE(0x00, streamFile);
|
||||
sample_rate = read_32bitLE(0x04, streamFile);
|
||||
interleave = read_32bitLE(0x08, streamFile) * 0x10; /* number of frames in a block */
|
||||
blocks = read_32bitLE(0x0c, streamFile); /* number of interleave blocks (even in mono) */
|
||||
int channels = read_s32le(0x00, sf);
|
||||
int sample_rate = read_s32le(0x04, sf);
|
||||
int interleave = read_s32le(0x08, sf) * 0x10; // number of frames in a block
|
||||
int blocks = read_s32le(0x0c, sf); // number of interleave blocks (even in mono)
|
||||
|
||||
file_size = get_streamfile_size(streamFile);
|
||||
loop_flag = 0;
|
||||
start_offset = 0x10;
|
||||
uint32_t start_offset = 0x10;
|
||||
uint32_t file_size = get_streamfile_size(sf);
|
||||
bool loop_flag = false;
|
||||
|
||||
/* extra checks since the header is so simple */
|
||||
if (channel_count < 1 || channel_count > 8)
|
||||
goto fail;
|
||||
// extra checks since the header is so simple
|
||||
if (channels < 1 || channels > 8)
|
||||
return NULL;
|
||||
|
||||
// Game can play 11025, 16000, 22050, 32000, 44100, 48000. Anything else will be
|
||||
// silent in-game. ST10.IMC subsongs 42-47 use 22000, those are unused silent audio
|
||||
if (sample_rate < 11025 || sample_rate > 48000)
|
||||
/* game can play 11025, 16000, 22050, 32000, 44100, 48000. Anything else will be
|
||||
silent in-game. ST10.IMC subsongs 42-47 use 22000, those are unused silent audio */
|
||||
goto fail;
|
||||
if (interleave*blocks + start_offset != file_size)
|
||||
goto fail;
|
||||
return NULL;
|
||||
|
||||
data_size = file_size - start_offset;
|
||||
data_size -= ps_find_padding(streamFile, start_offset, data_size, channel_count, interleave, 0);
|
||||
if (interleave * blocks + start_offset != file_size)
|
||||
return NULL;
|
||||
|
||||
uint32_t data_size = file_size - start_offset;
|
||||
data_size -= ps_find_padding(sf, start_offset, data_size, channels, interleave, 0);
|
||||
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count, loop_flag);
|
||||
vgmstream = allocate_vgmstream(channels, loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->meta_type = meta_IMC;
|
||||
vgmstream->sample_rate = sample_rate;
|
||||
vgmstream->num_samples = ps_bytes_to_samples(data_size, channel_count);
|
||||
vgmstream->num_samples = ps_bytes_to_samples(data_size, channels);
|
||||
vgmstream->coding_type = coding_PSX;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = interleave;
|
||||
|
||||
if (!vgmstream_open_stream(vgmstream,streamFile,start_offset))
|
||||
if (!vgmstream_open_stream(vgmstream, sf, start_offset))
|
||||
goto fail;
|
||||
return vgmstream;
|
||||
|
||||
|
@ -60,19 +58,19 @@ fail:
|
|||
/* ****************************************************************************** */
|
||||
|
||||
/* .IMC in containers */
|
||||
VGMSTREAM * init_vgmstream_imc_container(STREAMFILE *streamFile) {
|
||||
VGMSTREAM* init_vgmstream_imc_container(STREAMFILE* sf) {
|
||||
VGMSTREAM* vgmstream = NULL;
|
||||
STREAMFILE *temp_streamFile = NULL;
|
||||
STREAMFILE* temp_sf = NULL;
|
||||
off_t header_offset, subfile_offset, next_offset, name_offset;
|
||||
size_t subfile_size;
|
||||
int total_subsongs, target_subsong = streamFile->stream_index;
|
||||
int total_subsongs, target_subsong = sf->stream_index;
|
||||
|
||||
|
||||
/* checks */
|
||||
if (!check_extensions(streamFile, "imc"))
|
||||
goto fail;
|
||||
if (!check_extensions(sf, "imc"))
|
||||
return NULL;
|
||||
|
||||
total_subsongs = read_32bitLE(0x00, streamFile);
|
||||
total_subsongs = read_s32le(0x00, sf);
|
||||
if (target_subsong == 0) target_subsong = 1;
|
||||
if (target_subsong < 0 || target_subsong > total_subsongs || total_subsongs < 1) goto fail;
|
||||
|
||||
|
@ -82,34 +80,34 @@ VGMSTREAM * init_vgmstream_imc_container(STREAMFILE *streamFile) {
|
|||
name_offset = header_offset + 0x00;
|
||||
/* 0x08: flags? (0x702ADE77|0x002ADE77|0x20000000|etc) */
|
||||
/* 0x0c: same for all songs in single .imc but varies between .imc */
|
||||
subfile_offset = read_32bitLE(header_offset + 0x10,streamFile);
|
||||
subfile_offset = read_u32le(header_offset + 0x10,sf);
|
||||
/* 0x14: flags/size? (0xF0950000|0x3CFA1200|etc) */
|
||||
/* 0x18: same for all songs in single .imc but varies between .imc */
|
||||
/* 0x1c: flags? (0 or 2) */
|
||||
|
||||
if (target_subsong == total_subsongs) {
|
||||
next_offset = get_streamfile_size(streamFile);
|
||||
next_offset = get_streamfile_size(sf);
|
||||
}
|
||||
else {
|
||||
next_offset = read_32bitLE(header_offset + 0x20 + 0x10,streamFile);
|
||||
next_offset = read_u32le(header_offset + 0x20 + 0x10,sf);
|
||||
}
|
||||
subfile_size = next_offset - subfile_offset;
|
||||
|
||||
|
||||
temp_streamFile = setup_subfile_streamfile(streamFile, subfile_offset,subfile_size, NULL);
|
||||
if (!temp_streamFile) goto fail;
|
||||
temp_sf = setup_subfile_streamfile(sf, subfile_offset,subfile_size, NULL);
|
||||
if (!temp_sf) goto fail;
|
||||
|
||||
vgmstream = init_vgmstream_imc(temp_streamFile);
|
||||
vgmstream = init_vgmstream_imc(temp_sf);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
close_streamfile(temp_streamFile);
|
||||
vgmstream->num_streams = total_subsongs;
|
||||
read_string(vgmstream->stream_name,0x08+1, name_offset,streamFile);
|
||||
read_string(vgmstream->stream_name,0x08+1, name_offset,sf);
|
||||
|
||||
close_streamfile(temp_sf);
|
||||
return vgmstream;
|
||||
|
||||
fail:
|
||||
close_streamfile(temp_streamFile);
|
||||
close_streamfile(temp_sf);
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
||||
|
|
32
Frameworks/vgmstream/vgmstream/src/meta/kvag.c
Normal file
32
Frameworks/vgmstream/vgmstream/src/meta/kvag.c
Normal file
|
@ -0,0 +1,32 @@
|
|||
#include "meta.h"
|
||||
#include "../util/meta_utils.h"
|
||||
|
||||
/* KVAG - Mattel Hyperscan games [Marvel Heroes (Hyperscan), X-Men (Hyperscan)] */
|
||||
VGMSTREAM* init_vgmstream_hyperscan_kvag(STREAMFILE* sf) {
|
||||
|
||||
/* checks */
|
||||
if (!is_id32be(0x00,sf, "KVAG"))
|
||||
return NULL;
|
||||
if (!check_extensions(sf,"bvg"))
|
||||
return NULL;
|
||||
|
||||
meta_header_t h = {0};
|
||||
h.meta = meta_KVAG;
|
||||
|
||||
h.stream_size = read_u32le(0x04, sf);
|
||||
h.sample_rate = read_s32le(0x08, sf);
|
||||
h.channels = read_s16le(0x0c, sf) + 1;
|
||||
h.stream_offset = 0x0e;
|
||||
|
||||
if (h.channels > 2) // 2ch is rare [Ben 10's Theme22ks]
|
||||
return NULL;
|
||||
|
||||
h.num_samples = ima_bytes_to_samples(h.stream_size, h.channels);
|
||||
|
||||
h.coding = coding_DVI_IMA;
|
||||
h.layout = layout_none;
|
||||
h.open_stream = true;
|
||||
h.sf = sf;
|
||||
|
||||
return alloc_metastream(&h);
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
#include "meta.h"
|
||||
#include "../util.h"
|
||||
|
||||
/* Mattel Hyperscan,
|
||||
- Place all metas for this console here (there are just 5 games) */
|
||||
VGMSTREAM * init_vgmstream_hyperscan_kvag(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
char filename[PATH_LIMIT];
|
||||
off_t start_offset;
|
||||
int loop_flag = 0;
|
||||
int channel_count;
|
||||
|
||||
/* check extension, case insensitive */
|
||||
streamFile->get_name(streamFile,filename,sizeof(filename));
|
||||
if (strcasecmp("bvg",filename_extension(filename))) goto fail;
|
||||
|
||||
/* check header */
|
||||
if (read_32bitBE(0x00,streamFile) != 0x4B564147) /* "KVAG" */
|
||||
goto fail;
|
||||
|
||||
channel_count = 1;
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
/* fill in the vital statistics */
|
||||
start_offset = 0xE;
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = read_32bitLE(0x8,streamFile);
|
||||
vgmstream->coding_type = coding_DVI_IMA;
|
||||
vgmstream->num_samples = read_32bitLE(0x4,streamFile)*2;
|
||||
|
||||
#if 0
|
||||
if (loop_flag) {
|
||||
vgmstream->loop_start_sample = (read_32bitLE(0x08,streamFile)-1)*28;
|
||||
vgmstream->loop_end_sample = (read_32bitLE(0x0c,streamFile)-1)*28;
|
||||
}
|
||||
#endif
|
||||
|
||||
vgmstream->layout_type = layout_none;
|
||||
vgmstream->meta_type = meta_HYPERSCAN_KVAG;
|
||||
|
||||
/* open the file for reading */
|
||||
{
|
||||
int i;
|
||||
STREAMFILE * file;
|
||||
file = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE);
|
||||
if (!file) goto fail;
|
||||
for (i=0;i<channel_count;i++) {
|
||||
vgmstream->ch[i].streamfile = file;
|
||||
|
||||
vgmstream->ch[i].channel_start_offset=
|
||||
vgmstream->ch[i].offset=start_offset+
|
||||
vgmstream->interleave_block_size*i;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return vgmstream;
|
||||
|
||||
/* clean up anything we may have opened */
|
||||
fail:
|
||||
if (vgmstream) close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
|
@ -2,53 +2,49 @@
|
|||
#include "../util.h"
|
||||
|
||||
/* Maxis XA - found in Sim City 3000 (PC), The Sims 2 (PC) */
|
||||
VGMSTREAM * init_vgmstream_maxis_xa(STREAMFILE *streamFile) {
|
||||
VGMSTREAM* init_vgmstream_maxis_xa(STREAMFILE* sf) {
|
||||
VGMSTREAM* vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
int avg_byte_rate, channel_count, loop_flag, resolution, sample_align, sample_rate;
|
||||
|
||||
/* check extension, case insensitive */
|
||||
if (!check_extensions(streamFile,"xa"))
|
||||
goto fail;
|
||||
/* checks */
|
||||
if ((read_u32be(0x00,sf) & 0xFFFF0000) != get_id32be("XA\0\0")) // 02: "I"/"J"/null (version?)
|
||||
return NULL;
|
||||
|
||||
/* check header */
|
||||
if ((read_16bitBE(0x00,streamFile) != 0x5841)) /* "XA" */
|
||||
goto fail;
|
||||
uint32_t pcm_size = read_u32le(0x04,sf);
|
||||
if (read_u16le(0x08,sf) != 0x0001)
|
||||
return NULL;
|
||||
|
||||
/* check format tag */
|
||||
if ((read_16bitLE(0x08,streamFile) != 0x0001))
|
||||
goto fail;
|
||||
if (!check_extensions(sf,"xa"))
|
||||
return NULL;
|
||||
|
||||
channel_count = read_16bitLE(0x0A,streamFile);
|
||||
sample_rate = read_32bitLE(0x0C,streamFile);
|
||||
avg_byte_rate = read_32bitLE(0x10,streamFile);
|
||||
sample_align = read_16bitLE(0x14,streamFile);
|
||||
resolution = read_16bitLE(0x16,streamFile);
|
||||
int channels = read_s16le(0x0A,sf);
|
||||
int sample_rate = read_s32le(0x0C,sf);
|
||||
int avg_byte_rate = read_s32le(0x10,sf);
|
||||
int sample_align = read_u16le(0x14,sf);
|
||||
int resolution = read_u16le(0x16,sf);
|
||||
|
||||
/* check alignment */
|
||||
if (sample_align != (resolution/8)*channel_count)
|
||||
goto fail;
|
||||
if (sample_align != (resolution / 8) * channels)
|
||||
return NULL;
|
||||
|
||||
/* check average byte rate */
|
||||
if (avg_byte_rate != sample_rate * sample_align)
|
||||
goto fail;
|
||||
return NULL;
|
||||
|
||||
loop_flag = 0;
|
||||
start_offset = 0x18;
|
||||
off_t start_offset = 0x18;
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
vgmstream = allocate_vgmstream(channels, false);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->sample_rate = sample_rate;
|
||||
vgmstream->num_samples = read_32bitLE(0x04,streamFile)/2/channel_count;
|
||||
vgmstream->num_samples = pcm_size / sizeof(short) / channels;
|
||||
|
||||
vgmstream->meta_type = meta_MAXIS_XA;
|
||||
vgmstream->coding_type = coding_MAXIS_XA;
|
||||
vgmstream->layout_type = layout_none;
|
||||
|
||||
/* open streams */
|
||||
if (!vgmstream_open_stream(vgmstream,streamFile,start_offset))
|
||||
if (!vgmstream_open_stream(vgmstream, sf, start_offset))
|
||||
goto fail;
|
||||
return vgmstream;
|
||||
|
||||
|
|
|
@ -701,7 +701,7 @@ VGMSTREAM * init_vgmstream_msb_msh(STREAMFILE * streamFile);
|
|||
|
||||
VGMSTREAM * init_vgmstream_txtp(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_smc_smh(STREAMFILE * streamFile);
|
||||
VGMSTREAM* init_vgmstream_smh_smc(STREAMFILE* sf);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ppst(STREAMFILE *streamFile);
|
||||
|
||||
|
@ -1035,4 +1035,8 @@ VGMSTREAM* init_vgmstream_swar(STREAMFILE* sf);
|
|||
|
||||
VGMSTREAM* init_vgmstream_ivb(STREAMFILE* sf);
|
||||
|
||||
VGMSTREAM* init_vgmstream_mhwk(STREAMFILE* sf);
|
||||
|
||||
VGMSTREAM* init_vgmstream_srcd(STREAMFILE* sf);
|
||||
|
||||
#endif
|
||||
|
|
104
Frameworks/vgmstream/vgmstream/src/meta/mhwk.c
Normal file
104
Frameworks/vgmstream/vgmstream/src/meta/mhwk.c
Normal file
|
@ -0,0 +1,104 @@
|
|||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
|
||||
/* MHWK - Broderbund's Mohawk engine (.mhk) */
|
||||
VGMSTREAM* init_vgmstream_mhwk(STREAMFILE* sf) {
|
||||
VGMSTREAM* vgmstream = NULL;
|
||||
off_t start_offset = 0;
|
||||
int loop_flag = 0, channels = 0, sample_rate = 0, format = 0;
|
||||
int32_t num_samples = 0, loop_start = 0, loop_end = 0;
|
||||
off_t current_offset;
|
||||
uint32_t chunk_id;
|
||||
uint32_t chunk_size;
|
||||
|
||||
/* Check for MHWK magic word */
|
||||
if (!is_id32be(0x00, sf, "MHWK"))
|
||||
return NULL;
|
||||
|
||||
if (!check_extensions(sf, "mhk"))
|
||||
return NULL;
|
||||
|
||||
/* Check for WAVE magic word, which follows the MHWK header */
|
||||
if (!is_id32be(0x08, sf, "WAVE"))
|
||||
goto fail;
|
||||
|
||||
current_offset = 0x0C;
|
||||
|
||||
while (current_offset < get_streamfile_size(sf)) {
|
||||
chunk_id = read_u32be(current_offset, sf);
|
||||
chunk_size = read_u32be(current_offset + 0x04, sf);
|
||||
current_offset += 0x08;
|
||||
|
||||
if (chunk_id == get_id32be("Cue#")) {
|
||||
current_offset += chunk_size;
|
||||
continue;
|
||||
}
|
||||
else if (chunk_id == get_id32be("ADPC")) {
|
||||
current_offset += chunk_size;
|
||||
continue;
|
||||
}
|
||||
else if (chunk_id == get_id32be("Data")) {
|
||||
break;
|
||||
}
|
||||
else {
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
/* Data chunk header */
|
||||
|
||||
/* Header size is consistently 20 bytes from analysis */
|
||||
sample_rate = read_u16be(current_offset + 0x00, sf);
|
||||
num_samples = read_u32be(current_offset + 0x02, sf);
|
||||
/* 0x06: sample width (1 byte), 0x07: channels (1 byte) */
|
||||
channels = read_u8(current_offset + 0x07, sf);
|
||||
format = read_u16be(current_offset + 0x08, sf);
|
||||
|
||||
if (read_u16be(current_offset + 0x0A, sf) == 0xFFFF) {
|
||||
loop_flag = 1;
|
||||
loop_start = read_u32be(current_offset + 0x0C, sf);
|
||||
loop_end = read_u32be(current_offset + 0x10, sf);
|
||||
}
|
||||
|
||||
/* The actual audio data starts after the header's 20 bytes not 28 bytes */
|
||||
start_offset = current_offset + 0x14;
|
||||
|
||||
vgmstream = allocate_vgmstream(channels, loop_flag);
|
||||
if (!vgmstream)
|
||||
goto fail;
|
||||
|
||||
vgmstream->meta_type = meta_MHWK;
|
||||
vgmstream->sample_rate = sample_rate;
|
||||
vgmstream->num_samples = num_samples;
|
||||
vgmstream->loop_start_sample = loop_start;
|
||||
vgmstream->loop_end_sample = loop_end;
|
||||
|
||||
/* Determine coding type based on format ID */
|
||||
switch (format) {
|
||||
|
||||
//Myst 1993
|
||||
case 0x0000: /* 8-bit unsigned PCM. Default */
|
||||
vgmstream->coding_type = coding_PCM8_U;
|
||||
vgmstream->layout_type = layout_interleave; // Usually mono.
|
||||
vgmstream->interleave_block_size = 0x01;
|
||||
break;
|
||||
|
||||
//Carmen Sandiego: Word Detective
|
||||
case 0x0001: /* IMA ADPCM */
|
||||
vgmstream->coding_type = coding_IMA;
|
||||
vgmstream->layout_type = layout_none;
|
||||
break;
|
||||
|
||||
default: /* Unknown format */
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!vgmstream_open_stream(vgmstream, sf, start_offset))
|
||||
goto fail;
|
||||
|
||||
return vgmstream;
|
||||
|
||||
fail:
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
|
@ -2,48 +2,49 @@
|
|||
|
||||
|
||||
/* .seb - Game Arts games [Grandia (PS1), Grandia II/III/X (PS2)] */
|
||||
VGMSTREAM * init_vgmstream_seb(STREAMFILE *streamFile) {
|
||||
VGMSTREAM* init_vgmstream_seb(STREAMFILE* sf) {
|
||||
VGMSTREAM* vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
int loop_flag, channel_count;
|
||||
int loop_flag, channels;
|
||||
|
||||
|
||||
/* checks */
|
||||
channels = read_32bitLE(0x00,sf);
|
||||
if (channels > 2)
|
||||
return NULL;
|
||||
// 0x08/0c: unknown count, possibly related to looping
|
||||
|
||||
/* .seb: found in Grandia II (PS2) .idx */
|
||||
/* .gms: fake? (.stz+idx bigfile without names, except in Grandia II) */
|
||||
if (!check_extensions(streamFile, "seb,gms,"))
|
||||
goto fail;
|
||||
|
||||
channel_count = read_32bitLE(0x00,streamFile);
|
||||
if (channel_count > 2) goto fail; /* mono or stereo */
|
||||
/* 0x08/0c: unknown count, possibly related to looping */
|
||||
if (!check_extensions(sf, "seb,gms,"))
|
||||
return NULL;
|
||||
|
||||
start_offset = 0x800;
|
||||
|
||||
if (read_32bitLE(0x10,streamFile) > get_streamfile_size(streamFile) || /* loop start offset */
|
||||
read_32bitLE(0x18,streamFile) > get_streamfile_size(streamFile)) /* loop end offset */
|
||||
goto fail;
|
||||
if (read_u32le(0x10,sf) > get_streamfile_size(sf) || // loop start offset
|
||||
read_u32le(0x18,sf) > get_streamfile_size(sf)) // loop end offset
|
||||
return NULL;
|
||||
/* in Grandia III sometimes there is a value at 0x24/34 */
|
||||
|
||||
loop_flag = (read_32bitLE(0x20,streamFile) == 0);
|
||||
loop_flag = (read_s32le(0x20,sf) == 0);
|
||||
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
vgmstream = allocate_vgmstream(channels,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->meta_type = meta_SEB;
|
||||
vgmstream->sample_rate = read_32bitLE(0x04,streamFile);
|
||||
vgmstream->sample_rate = read_s32le(0x04,sf);
|
||||
|
||||
vgmstream->num_samples = read_32bitLE(0x1c,streamFile);
|
||||
vgmstream->loop_start_sample = read_32bitLE(0x14,streamFile);
|
||||
vgmstream->loop_end_sample = read_32bitLE(0x1c,streamFile);
|
||||
vgmstream->num_samples = read_s32le(0x1c,sf);
|
||||
vgmstream->loop_start_sample = read_s32le(0x14,sf);
|
||||
vgmstream->loop_end_sample = read_s32le(0x1c,sf);
|
||||
|
||||
vgmstream->coding_type = coding_PSX;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x800;
|
||||
|
||||
if (!vgmstream_open_stream(vgmstream,streamFile,start_offset))
|
||||
if (!vgmstream_open_stream(vgmstream, sf, start_offset))
|
||||
goto fail;
|
||||
return vgmstream;
|
||||
|
||||
|
|
|
@ -1,65 +0,0 @@
|
|||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
|
||||
/* SMC+SMH - from Wangan Midnight 1/R (System246) */
|
||||
VGMSTREAM * init_vgmstream_smc_smh(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
STREAMFILE * streamHeader = NULL;
|
||||
off_t start_offset, header_offset = 0;
|
||||
size_t stream_size;
|
||||
int loop_flag = 0, channel_count, sample_rate;
|
||||
int total_subsongs, target_subsong = streamFile->stream_index;
|
||||
|
||||
|
||||
/* checks */
|
||||
if (!check_extensions(streamFile, "smc"))
|
||||
goto fail;
|
||||
|
||||
streamHeader = open_streamfile_by_ext(streamFile, "smh");
|
||||
if (!streamHeader) goto fail;
|
||||
|
||||
|
||||
total_subsongs = read_32bitLE(0x00,streamHeader);
|
||||
if (target_subsong == 0) target_subsong = 1;
|
||||
if (target_subsong < 0 || target_subsong > total_subsongs || total_subsongs < 1) goto fail;
|
||||
|
||||
if (total_subsongs*0x10 + 0x10 != get_streamfile_size(streamHeader))
|
||||
goto fail;
|
||||
|
||||
header_offset = 0x10 + (target_subsong-1)*0x10;
|
||||
|
||||
start_offset = read_32bitLE(header_offset+0x00, streamHeader);
|
||||
stream_size = read_32bitLE(header_offset+0x04, streamHeader);
|
||||
sample_rate = read_32bitLE(header_offset+0x08, streamHeader);
|
||||
/* 0x0c(2): always 0x10, frame size? */
|
||||
channel_count = read_16bitLE(header_offset+0x0e, streamHeader);
|
||||
loop_flag = 0;
|
||||
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->sample_rate = sample_rate;
|
||||
vgmstream->num_samples = ps_bytes_to_samples(stream_size,channel_count);
|
||||
|
||||
vgmstream->num_streams = total_subsongs;
|
||||
vgmstream->stream_size = stream_size;
|
||||
vgmstream->meta_type = meta_SMC_SMH;
|
||||
|
||||
vgmstream->coding_type = coding_PSX;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = read_32bitLE(0x04, streamHeader);
|
||||
|
||||
|
||||
if (!vgmstream_open_stream(vgmstream,streamFile,start_offset))
|
||||
goto fail;
|
||||
|
||||
close_streamfile(streamHeader);
|
||||
return vgmstream;
|
||||
|
||||
fail:
|
||||
close_streamfile(streamHeader);
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
64
Frameworks/vgmstream/vgmstream/src/meta/smh_smc.c
Normal file
64
Frameworks/vgmstream/vgmstream/src/meta/smh_smc.c
Normal file
|
@ -0,0 +1,64 @@
|
|||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
|
||||
/* SMH+SMC - from Wangan Midnight 1/R (System246) */
|
||||
VGMSTREAM* init_vgmstream_smh_smc(STREAMFILE* sf) {
|
||||
VGMSTREAM* vgmstream = NULL;
|
||||
STREAMFILE* sb = NULL;
|
||||
off_t start_offset, header_offset = 0;
|
||||
size_t stream_size;
|
||||
int loop_flag = 0, channels, sample_rate;
|
||||
int total_subsongs, target_subsong = sf->stream_index;
|
||||
|
||||
|
||||
/* checks */
|
||||
if (!check_extensions(sf, "smh"))
|
||||
return NULL;
|
||||
|
||||
total_subsongs = read_s32le(0x00,sf);
|
||||
if (target_subsong == 0) target_subsong = 1;
|
||||
if (target_subsong < 0 || target_subsong > total_subsongs || total_subsongs < 1) goto fail;
|
||||
|
||||
if (total_subsongs * 0x10 + 0x10 != get_streamfile_size(sf))
|
||||
return NULL;
|
||||
|
||||
sb = open_streamfile_by_ext(sf, "smc");
|
||||
if (!sb) goto fail;
|
||||
|
||||
header_offset = 0x10 + (target_subsong - 1) * 0x10;
|
||||
|
||||
start_offset = read_u32le(header_offset+0x00, sf);
|
||||
stream_size = read_u32le(header_offset+0x04, sf);
|
||||
sample_rate = read_u32le(header_offset+0x08, sf);
|
||||
// 0x0c(2): always 0x10, frame size?
|
||||
channels = read_u16le(header_offset+0x0e, sf);
|
||||
loop_flag = 0;
|
||||
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channels, loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->sample_rate = sample_rate;
|
||||
vgmstream->num_samples = ps_bytes_to_samples(stream_size, channels);
|
||||
|
||||
vgmstream->num_streams = total_subsongs;
|
||||
vgmstream->stream_size = stream_size;
|
||||
vgmstream->meta_type = meta_SMC_SMH;
|
||||
|
||||
vgmstream->coding_type = coding_PSX;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = read_32bitLE(0x04, sf);
|
||||
|
||||
|
||||
if (!vgmstream_open_stream(vgmstream, sb, start_offset))
|
||||
goto fail;
|
||||
|
||||
close_streamfile(sb);
|
||||
return vgmstream;
|
||||
|
||||
fail:
|
||||
close_streamfile(sb);
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
124
Frameworks/vgmstream/vgmstream/src/meta/srcd.c
Normal file
124
Frameworks/vgmstream/vgmstream/src/meta/srcd.c
Normal file
|
@ -0,0 +1,124 @@
|
|||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
|
||||
/* srcd - Capcom RE Engine */
|
||||
VGMSTREAM* init_vgmstream_srcd(STREAMFILE* sf) {
|
||||
VGMSTREAM* vgmstream = NULL;
|
||||
STREAMFILE* subfile = NULL;
|
||||
off_t start_offset = 0;
|
||||
int loop_flag = 0;
|
||||
int32_t loop_start_sample = 0, loop_end_sample = 0;
|
||||
uint32_t container_type;
|
||||
const char* extension = NULL;
|
||||
VGMSTREAM* (*init_vgmstream_function)(STREAMFILE*) = NULL;
|
||||
|
||||
if (!is_id32be(0x00, sf, "srcd"))
|
||||
return NULL;
|
||||
|
||||
if (!check_extensions(sf, "srcd,asrc,14,21,26,31"))
|
||||
return NULL;
|
||||
|
||||
{
|
||||
enum versions { VERSION_31, VERSION_21_26, VERSION_14, VERSION_UNKNOWN };
|
||||
enum versions ver = VERSION_UNKNOWN;
|
||||
|
||||
//v31 - AJ_AAT
|
||||
if (read_u32le(0x18, sf) > 0x02) {
|
||||
ver = VERSION_31;
|
||||
}
|
||||
//v21 - CAS2
|
||||
else if (read_u32le(0x41, sf) == 0x49) {
|
||||
ver = VERSION_21_26;
|
||||
}
|
||||
//v26 - GTPD
|
||||
else if (read_u32le(0x46, sf) == 0x4E) {
|
||||
ver = VERSION_21_26;
|
||||
}
|
||||
//v14 - CAS
|
||||
else if (read_u8(0x3A, sf) == 0x42) {
|
||||
ver = VERSION_14;
|
||||
}
|
||||
|
||||
switch (ver) {
|
||||
case VERSION_31:
|
||||
loop_flag = read_u8(0x34, sf);
|
||||
loop_start_sample = read_u32le(0x35, sf);
|
||||
loop_end_sample = read_u32le(0x39, sf);
|
||||
break;
|
||||
|
||||
case VERSION_21_26:
|
||||
loop_flag = read_u8(0x2C, sf);
|
||||
loop_start_sample = read_u32le(0x2D, sf);
|
||||
loop_end_sample = read_u32le(0x31, sf);
|
||||
break;
|
||||
|
||||
case VERSION_14:
|
||||
loop_flag = read_u8(0x28, sf);
|
||||
loop_start_sample = read_u32le(0x29, sf);
|
||||
loop_end_sample = read_u32le(0x2D, sf);
|
||||
break;
|
||||
|
||||
default:
|
||||
VGM_LOG("SRCD: Unknown version, disabling loop\n");
|
||||
loop_flag = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
container_type = read_u32be(0x0C, sf);
|
||||
{
|
||||
const off_t scan_start = 0x40;
|
||||
const size_t scan_size = 0x100; //Should be small
|
||||
off_t current_offset;
|
||||
uint32_t magic_to_find = 0;
|
||||
|
||||
if (container_type == get_id32be("wav ")) {
|
||||
magic_to_find = get_id32be("RIFF");
|
||||
} else if (container_type == get_id32be("ogg ")) {
|
||||
magic_to_find = get_id32be("OggS");
|
||||
}
|
||||
|
||||
if (magic_to_find) {
|
||||
for (current_offset = scan_start; current_offset < scan_start + scan_size; current_offset++) {
|
||||
if (read_u32be(current_offset, sf) == magic_to_find) {
|
||||
start_offset = current_offset;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (start_offset == 0)
|
||||
goto fail;
|
||||
|
||||
|
||||
/* Select the appropriate init function and extension based on container type */
|
||||
if (container_type == get_id32be("wav ")) {
|
||||
extension = "wav";
|
||||
init_vgmstream_function = init_vgmstream_riff;
|
||||
} else if (container_type == get_id32be("ogg ")) {
|
||||
extension = "ogg";
|
||||
init_vgmstream_function = init_vgmstream_ogg_vorbis;
|
||||
} else {
|
||||
VGM_LOG("SRCD: Codec not recognized");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
subfile = setup_subfile_streamfile(sf, start_offset, get_streamfile_size(sf) - start_offset, extension);
|
||||
if (!subfile) goto fail;
|
||||
|
||||
vgmstream = init_vgmstream_function(subfile);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->meta_type = meta_SRCD;
|
||||
|
||||
vgmstream_force_loop(vgmstream, loop_flag, loop_start_sample, loop_end_sample);
|
||||
|
||||
close_streamfile(subfile);
|
||||
return vgmstream;
|
||||
|
||||
fail:
|
||||
close_streamfile(subfile);
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
|
@ -2,50 +2,50 @@
|
|||
#include "../coding/coding.h"
|
||||
|
||||
/* WV6 - Gorilla Systems PC games [Spy Kids: Mega Mission Zone (PC), Lilo & Stitch: Hawaiian Adventure (PC)] */
|
||||
VGMSTREAM * init_vgmstream_wv6(STREAMFILE *streamFile) {
|
||||
VGMSTREAM* init_vgmstream_wv6(STREAMFILE* sf) {
|
||||
VGMSTREAM* vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
int loop_flag, channel_count;
|
||||
int loop_flag, channels;
|
||||
|
||||
|
||||
/* checks */
|
||||
if (!check_extensions(streamFile, "wv6"))
|
||||
goto fail;
|
||||
if (read_u32le(0x00,sf) != get_streamfile_size(sf))
|
||||
return NULL;
|
||||
// 04: filename
|
||||
if (!is_id32be(0x2c,sf, "WV6 ") || !is_id32be(0x30,sf, "IMA_")) // "WV6 IMA_ADPCM COMPRESSED 16 BIT AUDIO"
|
||||
return NULL;
|
||||
|
||||
if (read_32bitLE(0x00,streamFile) != get_streamfile_size(streamFile))
|
||||
goto fail;
|
||||
if (read_32bitBE(0x2c,streamFile) != 0x57563620 || /* "WV6 " */
|
||||
read_32bitBE(0x30,streamFile) != 0x494D415F) /* "IMA_" ("WV6 IMA_ADPCM COMPRESSED 16 BIT AUDIO") */
|
||||
goto fail;
|
||||
if (!check_extensions(sf, "wv6"))
|
||||
return NULL;
|
||||
|
||||
/* 0x54/58/5c/60/6c: unknown (reject to catch possible stereo files, but don't seem to exist) */
|
||||
if (read_32bitLE(0x54,streamFile) != 0x01 ||
|
||||
read_32bitLE(0x58,streamFile) != 0x01 ||
|
||||
read_32bitLE(0x5c,streamFile) != 0x10 ||
|
||||
read_32bitLE(0x68,streamFile) != 0x01 ||
|
||||
read_32bitLE(0x6c,streamFile) != 0x88)
|
||||
goto fail;
|
||||
/* 0x64: PCM size (samples*channels*2) */
|
||||
// 0x54/58/5c/60/6c: unknown (reject to catch possible stereo files, but don't seem to exist)
|
||||
if (read_s32le(0x54,sf) != 0x01 ||
|
||||
read_s32le(0x58,sf) != 0x01 ||
|
||||
read_s32le(0x5c,sf) != 0x10 ||
|
||||
read_s32le(0x68,sf) != 0x01 ||
|
||||
read_s32le(0x6c,sf) != 0x88)
|
||||
return NULL;
|
||||
// 0x64: PCM size (samples * channels * 2)
|
||||
|
||||
channel_count = 1;
|
||||
channels = 1;
|
||||
loop_flag = 0;
|
||||
start_offset = 0x8c;
|
||||
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count, loop_flag);
|
||||
vgmstream = allocate_vgmstream(channels, loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->sample_rate = read_32bitLE(0x60, streamFile);
|
||||
vgmstream->num_samples = ima_bytes_to_samples(read_32bitLE(0x88,streamFile), channel_count);
|
||||
vgmstream->sample_rate = read_s32le(0x60, sf);
|
||||
vgmstream->num_samples = ima_bytes_to_samples(read_u32le(0x88,sf), channels);
|
||||
|
||||
vgmstream->meta_type = meta_WV6;
|
||||
vgmstream->coding_type = coding_WV6_IMA;
|
||||
vgmstream->layout_type = layout_none;
|
||||
|
||||
read_string(vgmstream->stream_name,0x1c+1, 0x04,streamFile);
|
||||
read_string(vgmstream->stream_name, 0x1c + 1, 0x04,sf);
|
||||
|
||||
if (!vgmstream_open_stream(vgmstream,streamFile,start_offset))
|
||||
if (!vgmstream_open_stream(vgmstream,sf,start_offset))
|
||||
goto fail;
|
||||
return vgmstream;
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ enum {
|
|||
VGMSTREAM_MAX_CHANNELS = 64, /* +40ch multilayers */
|
||||
VGMSTREAM_MIN_SAMPLE_RATE = 300, /* 300 is Wwise min */
|
||||
VGMSTREAM_MAX_SAMPLE_RATE = 192000, /* found in some FSB5 */
|
||||
VGMSTREAM_MAX_SUBSONGS = 65535, /* +20000 isn't that uncommon */
|
||||
VGMSTREAM_MAX_SUBSONGS = 90000, /* +20000 isn't that uncommon, known max is 89734 in EA NHL 14 sbs+sbr */
|
||||
VGMSTREAM_MAX_NUM_SAMPLES = 1000000000, /* no ~5h vgm hopefully */
|
||||
};
|
||||
|
||||
|
|
|
@ -317,7 +317,6 @@ init_vgmstream_t init_vgmstream_functions[] = {
|
|||
init_vgmstream_ubi_lyn_container,
|
||||
init_vgmstream_msb_msh,
|
||||
init_vgmstream_txtp,
|
||||
init_vgmstream_smc_smh,
|
||||
init_vgmstream_ppst,
|
||||
init_vgmstream_sps_n1_segmented,
|
||||
init_vgmstream_ubi_bao_pk,
|
||||
|
@ -330,7 +329,6 @@ init_vgmstream_t init_vgmstream_functions[] = {
|
|||
init_vgmstream_xmd,
|
||||
init_vgmstream_cks,
|
||||
init_vgmstream_ckb,
|
||||
init_vgmstream_wv6,
|
||||
init_vgmstream_str_wav,
|
||||
init_vgmstream_wavebatch,
|
||||
init_vgmstream_hd3_bd3,
|
||||
|
@ -368,8 +366,6 @@ init_vgmstream_t init_vgmstream_functions[] = {
|
|||
init_vgmstream_dsp_adpx,
|
||||
init_vgmstream_ogg_opus,
|
||||
init_vgmstream_nus3audio,
|
||||
init_vgmstream_imc,
|
||||
init_vgmstream_imc_container,
|
||||
init_vgmstream_smp,
|
||||
init_vgmstream_gin,
|
||||
init_vgmstream_dsf,
|
||||
|
@ -512,6 +508,8 @@ init_vgmstream_t init_vgmstream_functions[] = {
|
|||
init_vgmstream_audiopkg,
|
||||
init_vgmstream_swar,
|
||||
init_vgmstream_ivb,
|
||||
init_vgmstream_srcd,
|
||||
init_vgmstream_mhwk,
|
||||
|
||||
/* lower priority metas (no clean header identity, somewhat ambiguous, or need extension/companion file to identify) */
|
||||
init_vgmstream_agsc,
|
||||
|
@ -539,6 +537,10 @@ init_vgmstream_t init_vgmstream_functions[] = {
|
|||
init_vgmstream_vai,
|
||||
init_vgmstream_ezw,
|
||||
init_vgmstream_vgs_old,
|
||||
init_vgmstream_imc,
|
||||
init_vgmstream_imc_container,
|
||||
init_vgmstream_wv6,
|
||||
init_vgmstream_smh_smc,
|
||||
/* need companion files */
|
||||
init_vgmstream_pos,
|
||||
init_vgmstream_sli_loops,
|
||||
|
|
|
@ -496,7 +496,7 @@ typedef enum {
|
|||
meta_LSF_N1NJ4N, /* .lsf n1nj4n Fastlane Street Racing (iPhone) */
|
||||
meta_XWAV,
|
||||
meta_RAW_SNDS,
|
||||
meta_HYPERSCAN_KVAG, /* Hyperscan KVAG/BVG */
|
||||
meta_KVAG,
|
||||
meta_PSND,
|
||||
meta_ADP_WILDFIRE,
|
||||
meta_QD_ADP,
|
||||
|
@ -721,6 +721,8 @@ typedef enum {
|
|||
meta_AUDIOPKG,
|
||||
meta_SWAR,
|
||||
meta_IVB,
|
||||
meta_SRCD,
|
||||
meta_MHWK
|
||||
} meta_t;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -656,6 +656,7 @@
|
|||
<string>mds</string>
|
||||
<string>mdsp</string>
|
||||
<string>med</string>
|
||||
<string>mhwk</string>
|
||||
<string>mjb</string>
|
||||
<string>mi4</string>
|
||||
<string>mib</string>
|
||||
|
@ -829,7 +830,7 @@
|
|||
<string>skx</string>
|
||||
<string>slb</string>
|
||||
<string>sli</string>
|
||||
<string>smc</string>
|
||||
<string>smh</string>
|
||||
<string>smk</string>
|
||||
<string>smp</string>
|
||||
<string>smv</string>
|
||||
|
@ -851,6 +852,7 @@
|
|||
<string>spsd</string>
|
||||
<string>spw</string>
|
||||
<string>srsa</string>
|
||||
<string>srcd</string>
|
||||
<string>ss2</string>
|
||||
<string>ssd</string>
|
||||
<string>ssf</string>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
17C93F080B8FF67A008627D6 /* FlacDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C93F040B8FF67A008627D6 /* FlacDecoder.m */; };
|
||||
8301C147287805F500651A6E /* NSDictionary+Merge.m in Sources */ = {isa = PBXBuildFile; fileRef = 8301C146287805F500651A6E /* NSDictionary+Merge.m */; };
|
||||
834D18FE2D7F949900F13B89 /* CogAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 834D18FD2D7F949900F13B89 /* CogAudio.framework */; };
|
||||
836EF0DA27BB970B00BF35B2 /* libFLAC.12.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 836EF0D927BB970B00BF35B2 /* libFLAC.12.dylib */; };
|
||||
836EF0DA27BB970B00BF35B2 /* libFLAC.14.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 836EF0D927BB970B00BF35B2 /* libFLAC.14.dylib */; };
|
||||
83AA660B27B7DAE40098D4B8 /* cuesheet.m in Sources */ = {isa = PBXBuildFile; fileRef = 83AA660A27B7DAE40098D4B8 /* cuesheet.m */; };
|
||||
8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
@ -40,7 +40,7 @@
|
|||
834A42B4287AF7AA00EB9D9B /* AudioChunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AudioChunk.h; path = ../../Audio/Chain/AudioChunk.h; sourceTree = "<group>"; };
|
||||
834D18FD2D7F949900F13B89 /* CogAudio.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = CogAudio.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8356BD1927B3CCBB0074E50C /* HTTPSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTTPSource.h; path = ../HTTPSource/HTTPSource.h; sourceTree = "<group>"; };
|
||||
836EF0D927BB970B00BF35B2 /* libFLAC.12.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libFLAC.12.dylib; path = ../../ThirdParty/flac/lib/libFLAC.12.dylib; sourceTree = "<group>"; };
|
||||
836EF0D927BB970B00BF35B2 /* libFLAC.14.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libFLAC.14.dylib; path = ../../ThirdParty/flac/lib/libFLAC.14.dylib; sourceTree = "<group>"; };
|
||||
83747C4A2862DCF40021245F /* Shared.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Shared.xcconfig; sourceTree = "<group>"; };
|
||||
8384912D180816C900E7332D /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Logging.h; path = ../../Utils/Logging.h; sourceTree = "<group>"; };
|
||||
83AA660A27B7DAE40098D4B8 /* cuesheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = cuesheet.m; sourceTree = "<group>"; };
|
||||
|
@ -56,7 +56,7 @@
|
|||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
834D18FE2D7F949900F13B89 /* CogAudio.framework in Frameworks */,
|
||||
836EF0DA27BB970B00BF35B2 /* libFLAC.12.dylib in Frameworks */,
|
||||
836EF0DA27BB970B00BF35B2 /* libFLAC.14.dylib in Frameworks */,
|
||||
8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -115,7 +115,7 @@
|
|||
1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
836EF0D927BB970B00BF35B2 /* libFLAC.12.dylib */,
|
||||
836EF0D927BB970B00BF35B2 /* libFLAC.14.dylib */,
|
||||
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */,
|
||||
);
|
||||
name = "Linked Frameworks";
|
||||
|
|
|
@ -337,6 +337,8 @@ void ErrorCallback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorS
|
|||
FLAC__StreamDecoderInitStatus ret;
|
||||
|
||||
if(isOggFlac) {
|
||||
FLAC__stream_decoder_set_decode_chained_stream(decoder, true);
|
||||
|
||||
ret = FLAC__stream_decoder_init_ogg_stream(decoder,
|
||||
ReadCallback,
|
||||
([source seekable] ? SeekCallback : NULL),
|
||||
|
@ -384,8 +386,13 @@ void ErrorCallback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorS
|
|||
AudioChunk *chunk = nil;
|
||||
|
||||
while (blockBufferFrames <= 0) {
|
||||
if(FLAC__stream_decoder_get_state(decoder) == FLAC__STREAM_DECODER_END_OF_STREAM) {
|
||||
FLAC__StreamDecoderState state = FLAC__stream_decoder_get_state(decoder);
|
||||
if(state == FLAC__STREAM_DECODER_END_OF_STREAM) {
|
||||
return nil;
|
||||
} else if(state == FLAC__STREAM_DECODER_END_OF_LINK) {
|
||||
if(!FLAC__stream_decoder_finish_link(decoder)) {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
if(!FLAC__stream_decoder_process_single(decoder)) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
8301C14928780C1A00651A6E /* libFLAC.12.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8301C14828780C1A00651A6E /* libFLAC.12.dylib */; };
|
||||
8301C14928780C1A00651A6E /* libFLAC.14.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8301C14828780C1A00651A6E /* libFLAC.14.dylib */; };
|
||||
83186316285CEC91001422CC /* NSDictionary+Merge.m in Sources */ = {isa = PBXBuildFile; fileRef = 83186315285CEC91001422CC /* NSDictionary+Merge.m */; };
|
||||
834D19102D7F956400F13B89 /* CogAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 834D190F2D7F956400F13B89 /* CogAudio.framework */; };
|
||||
836EF0CF27BB952F00BF35B2 /* libopusfile.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 836EF0CE27BB952F00BF35B2 /* libopusfile.0.dylib */; };
|
||||
|
@ -29,7 +29,7 @@
|
|||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
8301C14828780C1A00651A6E /* libFLAC.12.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libFLAC.12.dylib; path = ../../ThirdParty/flac/lib/libFLAC.12.dylib; sourceTree = "<group>"; };
|
||||
8301C14828780C1A00651A6E /* libFLAC.14.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libFLAC.14.dylib; path = ../../ThirdParty/flac/lib/libFLAC.14.dylib; sourceTree = "<group>"; };
|
||||
83186314285CEC91001422CC /* NSDictionary+Merge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSDictionary+Merge.h"; path = "../../../Utils/NSDictionary+Merge.h"; sourceTree = "<group>"; };
|
||||
83186315285CEC91001422CC /* NSDictionary+Merge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSDictionary+Merge.m"; path = "../../../Utils/NSDictionary+Merge.m"; sourceTree = "<group>"; };
|
||||
833F68411CDBCABC00AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
|
@ -61,7 +61,7 @@
|
|||
files = (
|
||||
834D19102D7F956400F13B89 /* CogAudio.framework in Frameworks */,
|
||||
8375B04017FFEA400092A79F /* Cocoa.framework in Frameworks */,
|
||||
8301C14928780C1A00651A6E /* libFLAC.12.dylib in Frameworks */,
|
||||
8301C14928780C1A00651A6E /* libFLAC.14.dylib in Frameworks */,
|
||||
836EF0CF27BB952F00BF35B2 /* libopusfile.0.dylib in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -100,7 +100,7 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
834D190F2D7F956400F13B89 /* CogAudio.framework */,
|
||||
8301C14828780C1A00651A6E /* libFLAC.12.dylib */,
|
||||
8301C14828780C1A00651A6E /* libFLAC.14.dylib */,
|
||||
836EF0CE27BB952F00BF35B2 /* libopusfile.0.dylib */,
|
||||
8375B03F17FFEA400092A79F /* Cocoa.framework */,
|
||||
8375B04117FFEA400092A79F /* Other Frameworks */,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
/* Begin PBXBuildFile section */
|
||||
17C93D360B8FDA66008627D6 /* VorbisDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C93D340B8FDA66008627D6 /* VorbisDecoder.m */; };
|
||||
8301C14B287810F300651A6E /* libFLAC.12.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8301C14A287810F300651A6E /* libFLAC.12.dylib */; };
|
||||
8301C14B287810F300651A6E /* libFLAC.14.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8301C14A287810F300651A6E /* libFLAC.14.dylib */; };
|
||||
83186313285CEBD2001422CC /* NSDictionary+Merge.m in Sources */ = {isa = PBXBuildFile; fileRef = 83186312285CEBD2001422CC /* NSDictionary+Merge.m */; };
|
||||
834D19172D7F95A600F13B89 /* CogAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 834D19162D7F95A600F13B89 /* CogAudio.framework */; };
|
||||
836EF0D627BB969D00BF35B2 /* libvorbisfile.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 836EF0D427BB969D00BF35B2 /* libvorbisfile.3.dylib */; };
|
||||
|
@ -26,7 +26,7 @@
|
|||
17C93D330B8FDA66008627D6 /* VorbisDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = VorbisDecoder.h; sourceTree = "<group>"; };
|
||||
17C93D340B8FDA66008627D6 /* VorbisDecoder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = VorbisDecoder.m; sourceTree = "<group>"; };
|
||||
32DBCF630370AF2F00C91783 /* VorbisPlugin_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VorbisPlugin_Prefix.pch; sourceTree = "<group>"; };
|
||||
8301C14A287810F300651A6E /* libFLAC.12.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libFLAC.12.dylib; path = ../../ThirdParty/flac/lib/libFLAC.12.dylib; sourceTree = "<group>"; };
|
||||
8301C14A287810F300651A6E /* libFLAC.14.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libFLAC.14.dylib; path = ../../ThirdParty/flac/lib/libFLAC.14.dylib; sourceTree = "<group>"; };
|
||||
83186311285CEBD2001422CC /* NSDictionary+Merge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSDictionary+Merge.h"; path = "../../Utils/NSDictionary+Merge.h"; sourceTree = "<group>"; };
|
||||
83186312285CEBD2001422CC /* NSDictionary+Merge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSDictionary+Merge.m"; path = "../../Utils/NSDictionary+Merge.m"; sourceTree = "<group>"; };
|
||||
834A42AB287AF0B000EB9D9B /* AudioChunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AudioChunk.h; path = ../../Audio/Chain/AudioChunk.h; sourceTree = "<group>"; };
|
||||
|
@ -51,7 +51,7 @@
|
|||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
834D19172D7F95A600F13B89 /* CogAudio.framework in Frameworks */,
|
||||
8301C14B287810F300651A6E /* libFLAC.12.dylib in Frameworks */,
|
||||
8301C14B287810F300651A6E /* libFLAC.14.dylib in Frameworks */,
|
||||
8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */,
|
||||
836EF0DF27BB987000BF35B2 /* libvorbis.0.dylib in Frameworks */,
|
||||
836EF0D627BB969D00BF35B2 /* libvorbisfile.3.dylib in Frameworks */,
|
||||
|
@ -111,7 +111,7 @@
|
|||
1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8301C14A287810F300651A6E /* libFLAC.12.dylib */,
|
||||
8301C14A287810F300651A6E /* libFLAC.14.dylib */,
|
||||
836EF0DE27BB987000BF35B2 /* libvorbis.0.dylib */,
|
||||
836EF0D427BB969D00BF35B2 /* libvorbisfile.3.dylib */,
|
||||
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */,
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
DATA_LOADER* dLoad;
|
||||
PlayerA* mainPlr;
|
||||
id<CogSource> source;
|
||||
UINT8* sampleBuffer;
|
||||
double sampleRate;
|
||||
long loopCount;
|
||||
double fadeTime;
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
|
||||
@implementation libvgmDecoder
|
||||
|
||||
enum { bufferSize = 1024 };
|
||||
|
||||
#ifdef _DEBUG
|
||||
const int logLevel = DEVLOG_DEBUG;
|
||||
#else
|
||||
|
@ -99,6 +101,7 @@ const int masterVol = 0x10000; // Fixed point 16.16
|
|||
fileData = NULL;
|
||||
dLoad = NULL;
|
||||
mainPlr = NULL;
|
||||
sampleBuffer = NULL;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@ -130,6 +133,7 @@ const int masterVol = 0x10000; // Fixed point 16.16
|
|||
BOOL repeatOne = IsRepeatOneSet();
|
||||
uint32_t maxLoops = repeatOne ? 0 : (uint32_t)loopCount;
|
||||
|
||||
try {
|
||||
mainPlr = new PlayerA;
|
||||
mainPlr->RegisterPlayerEngine(new VGMPlayer);
|
||||
mainPlr->RegisterPlayerEngine(new S98Player);
|
||||
|
@ -186,6 +190,14 @@ const int masterVol = 0x10000; // Fixed point 16.16
|
|||
[self setTrackEnded:NO];
|
||||
|
||||
mainPlr->Start();
|
||||
} catch(std::exception& e) {
|
||||
ALog(@"Exception caught opening file: %s\n", e.what());
|
||||
return NO;
|
||||
}
|
||||
|
||||
sampleBuffer = (UINT8*) malloc(bufferSize * numChannels * (numBitsPerSample / 8));
|
||||
if(!sampleBuffer)
|
||||
return NO;
|
||||
|
||||
[self willChangeValueForKey:@"properties"];
|
||||
[self didChangeValueForKey:@"properties"];
|
||||
|
@ -215,15 +227,18 @@ const int masterVol = 0x10000; // Fixed point 16.16
|
|||
id audioChunkClass = NSClassFromString(@"AudioChunk");
|
||||
AudioChunk* chunk = [[audioChunkClass alloc] initWithProperties:[self properties]];
|
||||
|
||||
int frames = 1024;
|
||||
const size_t bytesPerFrame = [chunk format].mBytesPerFrame;
|
||||
uint8_t buffer[frames * bytesPerFrame];
|
||||
int frames = bufferSize;
|
||||
const int bytesPerFrame = [chunk format].mBytesPerFrame;
|
||||
|
||||
void* buf = (void*)buffer;
|
||||
void* buf = (void*)sampleBuffer;
|
||||
|
||||
BOOL repeatOne = IsRepeatOneSet();
|
||||
uint32_t maxLoops = repeatOne ? 0 : (uint32_t)loopCount;
|
||||
|
||||
double streamTimestamp;
|
||||
UInt32 framesDone = 0;
|
||||
|
||||
try {
|
||||
PlayerBase* player = mainPlr->GetPlayer();
|
||||
mainPlr->SetLoopCount(maxLoops);
|
||||
if(player->GetPlayerType() == FCC_VGM) {
|
||||
|
@ -231,26 +246,33 @@ const int masterVol = 0x10000; // Fixed point 16.16
|
|||
mainPlr->SetLoopCount(vgmplay->GetModifiedLoopCount(maxLoops));
|
||||
}
|
||||
|
||||
double streamTimestamp = mainPlr->GetCurTime(0);
|
||||
|
||||
UInt32 framesDone = 0;
|
||||
streamTimestamp = mainPlr->GetCurTime(0);
|
||||
|
||||
while(framesDone < frames) {
|
||||
UInt32 framesToDo = frames - framesDone;
|
||||
if(framesToDo > smplAlloc)
|
||||
framesToDo = smplAlloc;
|
||||
|
||||
int numSamples = framesToDo * numChannels * (numBitsPerSample / 8);
|
||||
int numSamples = framesToDo * bytesPerFrame;
|
||||
|
||||
mainPlr->Render(numSamples, buf);
|
||||
UINT32 numRendered = mainPlr->Render(numSamples, buf);
|
||||
|
||||
buf = (void*)(((uint8_t*)buf) + numSamples);
|
||||
buf = (void*)(((uint8_t*)buf) + numRendered);
|
||||
|
||||
framesDone += framesToDo;
|
||||
UINT32 framesRendered = numRendered / bytesPerFrame;
|
||||
|
||||
framesDone += framesRendered;
|
||||
|
||||
if(framesRendered < framesToDo)
|
||||
break;
|
||||
}
|
||||
} catch(std::exception& e) {
|
||||
ALog(@"Exception caught while playing track: %s\n", e.what());
|
||||
return nil;
|
||||
}
|
||||
|
||||
[chunk setStreamTimestamp:streamTimestamp];
|
||||
[chunk assignSamples:buffer frameCount:framesDone];
|
||||
[chunk assignSamples:sampleBuffer frameCount:framesDone];
|
||||
|
||||
return chunk;
|
||||
}
|
||||
|
@ -264,6 +286,11 @@ const int masterVol = 0x10000; // Fixed point 16.16
|
|||
}
|
||||
|
||||
- (void)close {
|
||||
if(sampleBuffer) {
|
||||
free(sampleBuffer);
|
||||
sampleBuffer = NULL;
|
||||
}
|
||||
try {
|
||||
if(mainPlr) {
|
||||
mainPlr->Stop();
|
||||
mainPlr->UnloadFile();
|
||||
|
@ -275,6 +302,9 @@ const int masterVol = 0x10000; // Fixed point 16.16
|
|||
DataLoader_Deinit(dLoad);
|
||||
dLoad = NULL;
|
||||
}
|
||||
} catch(std::exception& e) {
|
||||
ALog(@"Exception caught cleaning up player: %s\n", e.what());
|
||||
}
|
||||
if(fileData) {
|
||||
free(fileData);
|
||||
fileData = NULL;
|
||||
|
|
17
ThirdParty/flac/README.md
vendored
17
ThirdParty/flac/README.md
vendored
|
@ -1,18 +1,21 @@
|
|||
Build with CMake, using the following options:
|
||||
|
||||
```
|
||||
cmake -B build-x86 -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" -DBUILD_SHARED_LIBS=ON
|
||||
cmake -B build-arm -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" -DBUILD_SHARED_LIBS=ON
|
||||
cmake -B build-x86 -DCMAKE_LIBRARY_PATH=/usr/local/lib -DCMAKE_OSX_ARCHITECTURES="x86_64" \
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=ON
|
||||
cmake -B build-arm -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=ON
|
||||
```
|
||||
|
||||
For the debug overlay, BUILD_TYPE was replaced with `Debug`.
|
||||
|
||||
And some minor tweaks with `install_name_tool -id` to make sure that the
|
||||
resulting libFLAC.12.dylib referred to itself with @rpath and not full
|
||||
paths of the build directory, and imported libogg.0.dylib with an @rpath.
|
||||
And some minor tweaks with `install_name_tool -change` to fix up the
|
||||
resulting libFLAC.14.dylib so that it imports libogg.0.dylib using an
|
||||
@rpath path instead of an absolute path to Homebrew's install.
|
||||
|
||||
Version 1.4.3 was used from the official source code download:
|
||||
Version 1.5.0 was used from the official source code download:
|
||||
|
||||
https://downloads.xiph.org/releases/flac/flac-1.4.3.tar.xz
|
||||
https://downloads.xiph.org/releases/flac/flac-1.5.0.tar.xz
|
||||
|
||||
x86_64 and arm64 were built separately, to allow for intrinsic functions
|
||||
to be used for x86_64.
|
||||
|
|
2
ThirdParty/flac/include/FLAC/FLAC_assert.h
vendored
2
ThirdParty/flac/include/FLAC/FLAC_assert.h
vendored
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2001-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2025 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
52
ThirdParty/flac/include/FLAC/all.h
vendored
52
ThirdParty/flac/include/FLAC/all.h
vendored
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2025 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -436,6 +436,56 @@
|
|||
*
|
||||
*/
|
||||
|
||||
/** \defgroup porting_1_4_3_to_1_5_0 Porting from FLAC 1.4.3 to 1.5.0
|
||||
* \ingroup porting
|
||||
*
|
||||
* \brief
|
||||
* This module describes porting from FLAC 1.4.3 to FLAC 1.5.0.
|
||||
*
|
||||
* \section porting_1_4_3_to_1_5_0_summary Summary
|
||||
*
|
||||
* Between FLAC 1.4.3 and FLAC 1.5.0, there have been changes to
|
||||
* existing C functions and enums:
|
||||
* - the functions FLAC__metadata_get_streaminfo,
|
||||
* FLAC__metadata_get_tags and FLAC__metadata_get_cuesheet can now
|
||||
* read from Ogg FLAC files
|
||||
* - when encoding Ogg FLAC files, the 'samples' argument of the
|
||||
* write callback no longer always returns 0.
|
||||
* - two error statuses have been added to the
|
||||
* FLAC__StreamDecoderErrorStatus enum
|
||||
* - one status is added to FLAC__StreamDecoderState, which is only
|
||||
* used when the new decoding of chained streams functionality is
|
||||
* enabled
|
||||
* - one status is added to FLAC__StreamDecoderReadStatus, which is
|
||||
* only used when the new decoding of chained streams functionality
|
||||
* is enabled
|
||||
* - the function
|
||||
* FLAC__metadata_chain_write_with_callbacks_and_tempfile can now
|
||||
* be used regardless of whether a tempfile is actually needed,
|
||||
* which is useful when writing to a new file is desired anyway
|
||||
*
|
||||
* Furthermore, there have been the following additions:
|
||||
* - the functions FLAC__stream_decoder_set_decode_chained_stream,
|
||||
* FLAC__stream_decoder_get_decode_chained_stream,
|
||||
* FLAC__stream_decoder_finish_link,
|
||||
* FLAC__stream_decoder_skip_single_link,
|
||||
* FLAC__stream_decoder_process_until_end_of_link and
|
||||
* FLAC__stream_decoder_get_link_lengths have been added
|
||||
* to support decoding of chained streams
|
||||
* - the function FLAC__metadata_chain_write_new_file has been added,
|
||||
* which is useful to combine copying of a file with changing its
|
||||
* metadata
|
||||
* - the function FLAC__stream_decoder_find_total_samples was added,
|
||||
* which seeks to the end of a file to find the total number of
|
||||
* samples
|
||||
* - the function FLAC__stream_encoder_set_num_threads and
|
||||
* FLAC__stream_encoder_get_num_threads have been added, which
|
||||
* can be used to enable multithreading in the encoder
|
||||
*
|
||||
* For the C++ API, changes are the same, but in C++ nomenclature
|
||||
*
|
||||
*/
|
||||
|
||||
/** \defgroup flac FLAC C API
|
||||
*
|
||||
* The FLAC C API is the interface to libFLAC, a set of structures
|
||||
|
|
2
ThirdParty/flac/include/FLAC/callback.h
vendored
2
ThirdParty/flac/include/FLAC/callback.h
vendored
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2004-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2025 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
6
ThirdParty/flac/include/FLAC/export.h
vendored
6
ThirdParty/flac/include/FLAC/export.h
vendored
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2025 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -95,9 +95,9 @@
|
|||
/** These \#defines will mirror the libtool-based library version number, see
|
||||
* http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning
|
||||
*/
|
||||
#define FLAC_API_VERSION_CURRENT 13
|
||||
#define FLAC_API_VERSION_CURRENT 14
|
||||
#define FLAC_API_VERSION_REVISION 0 /**< see above */
|
||||
#define FLAC_API_VERSION_AGE 1 /**< see above */
|
||||
#define FLAC_API_VERSION_AGE 0 /**< see above */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
2
ThirdParty/flac/include/FLAC/format.h
vendored
2
ThirdParty/flac/include/FLAC/format.h
vendored
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2025 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
72
ThirdParty/flac/include/FLAC/metadata.h
vendored
72
ThirdParty/flac/include/FLAC/metadata.h
vendored
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2001-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2025 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -62,9 +62,9 @@
|
|||
* This module provides functions for creating and manipulating FLAC
|
||||
* metadata blocks in memory, and three progressively more powerful
|
||||
* interfaces for traversing and editing metadata in native FLAC files.
|
||||
* Note that currently only the Chain interface (level 2) supports Ogg
|
||||
* FLAC files, and it is read-only i.e. no writing back changed
|
||||
* metadata to file.
|
||||
* Note that currently only the Chain interface (level 2) and some
|
||||
* functions in level 0 supports Ogg FLAC files, and they are
|
||||
* read-only i.e. no writing back changed metadata to file.
|
||||
*
|
||||
* There are three metadata interfaces of increasing complexity:
|
||||
*
|
||||
|
@ -144,10 +144,11 @@ extern "C" {
|
|||
* \{
|
||||
*/
|
||||
|
||||
/** Read the STREAMINFO metadata block of the given FLAC file. This function
|
||||
* will try to skip any ID3v2 tag at the head of the file.
|
||||
/** Read the STREAMINFO metadata block of the given FLAC or Ogg FLAC
|
||||
* file. This function will try to skip any ID3v2 tag at the head
|
||||
* of the file.
|
||||
*
|
||||
* \param filename The path to the FLAC file to read.
|
||||
* \param filename The path to the FLAC or Ogg FLAC file to read.
|
||||
* \param streaminfo A pointer to space for the STREAMINFO block. Since
|
||||
* FLAC__StreamMetadata is a simple structure with no
|
||||
* memory allocation involved, you pass the address of
|
||||
|
@ -163,10 +164,11 @@ extern "C" {
|
|||
*/
|
||||
FLAC_API FLAC__bool FLAC__metadata_get_streaminfo(const char *filename, FLAC__StreamMetadata *streaminfo);
|
||||
|
||||
/** Read the VORBIS_COMMENT metadata block of the given FLAC file. This
|
||||
* function will try to skip any ID3v2 tag at the head of the file.
|
||||
/** Read the VORBIS_COMMENT metadata block of the given FLAC or Ogg FLAC
|
||||
* file. This function will try to skip any ID3v2 tag at the head
|
||||
* of the file.
|
||||
*
|
||||
* \param filename The path to the FLAC file to read.
|
||||
* \param filename The path to the FLAC or Ogg FLAC file to read.
|
||||
* \param tags The address where the returned pointer will be
|
||||
* stored. The \a tags object must be deleted by
|
||||
* the caller using FLAC__metadata_object_delete().
|
||||
|
@ -182,10 +184,11 @@ FLAC_API FLAC__bool FLAC__metadata_get_streaminfo(const char *filename, FLAC__St
|
|||
*/
|
||||
FLAC_API FLAC__bool FLAC__metadata_get_tags(const char *filename, FLAC__StreamMetadata **tags);
|
||||
|
||||
/** Read the CUESHEET metadata block of the given FLAC file. This
|
||||
* function will try to skip any ID3v2 tag at the head of the file.
|
||||
/** Read the CUESHEET metadata block of the given FLAC or Ogg FLAC
|
||||
* file. This function will try to skip any ID3v2 tag at the head
|
||||
* of the file.
|
||||
*
|
||||
* \param filename The path to the FLAC file to read.
|
||||
* \param filename The path to the FLAC or Ogg FLAC file to read.
|
||||
* \param cuesheet The address where the returned pointer will be
|
||||
* stored. The \a cuesheet object must be deleted by
|
||||
* the caller using FLAC__metadata_object_delete().
|
||||
|
@ -207,7 +210,8 @@ FLAC_API FLAC__bool FLAC__metadata_get_cuesheet(const char *filename, FLAC__Stre
|
|||
* function takes a number of parameters that act as constraints to
|
||||
* the search. The PICTURE block with the largest area matching all
|
||||
* the constraints will be returned, or \a *picture will be set to
|
||||
* \c NULL if there was no such block.
|
||||
* \c NULL if there was no such block. This function does not
|
||||
* currently support reading from Ogg FLAC files.
|
||||
*
|
||||
* \param filename The path to the FLAC file to read.
|
||||
* \param picture The address where the returned pointer will be
|
||||
|
@ -784,9 +788,6 @@ typedef enum {
|
|||
/**< FLAC__metadata_chain_write_with_callbacks() was called when the
|
||||
* chain write requires a tempfile; use
|
||||
* FLAC__metadata_chain_write_with_callbacks_and_tempfile() instead.
|
||||
* Or, FLAC__metadata_chain_write_with_callbacks_and_tempfile() was
|
||||
* called when the chain write does not require a tempfile; use
|
||||
* FLAC__metadata_chain_write_with_callbacks() instead.
|
||||
* Always check FLAC__metadata_chain_check_if_tempfile_needed()
|
||||
* before writing via callbacks. */
|
||||
|
||||
|
@ -923,11 +924,11 @@ FLAC_API FLAC__bool FLAC__metadata_chain_read_ogg_with_callbacks(FLAC__Metadata_
|
|||
* edited metadata back to the FLAC file does not require rewriting the
|
||||
* entire file. If rewriting is required, then a temporary workfile is
|
||||
* required. When writing metadata using callbacks, you must check
|
||||
* this function to know whether to call
|
||||
* FLAC__metadata_chain_write_with_callbacks() or
|
||||
* FLAC__metadata_chain_write_with_callbacks_and_tempfile(). When
|
||||
* writing with FLAC__metadata_chain_write(), the temporary file is
|
||||
* handled internally.
|
||||
* this function to know whether
|
||||
* FLAC__metadata_chain_write_with_callbacks() can be used or
|
||||
* FLAC__metadata_chain_write_with_callbacks_and_tempfile() is
|
||||
* necessary. When writing with FLAC__metadata_chain_write(), the
|
||||
* temporary file is handled internally.
|
||||
*
|
||||
* \param chain A pointer to an existing chain.
|
||||
* \param use_padding
|
||||
|
@ -990,6 +991,28 @@ FLAC_API FLAC__bool FLAC__metadata_chain_check_if_tempfile_needed(FLAC__Metadata
|
|||
*/
|
||||
FLAC_API FLAC__bool FLAC__metadata_chain_write(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__bool preserve_file_stats);
|
||||
|
||||
/** Write all metadata out to a new FLAC file.
|
||||
*
|
||||
* This function works similar to FLAC__metadata_chain_write(), but is
|
||||
* useful if writing to a new file is desired. This is more efficient
|
||||
* than copying the file before changing it.
|
||||
*
|
||||
* For this write function to be used, the chain must have been read with
|
||||
* FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(), not
|
||||
* FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks().
|
||||
* See also FLAC__metadata_chain_write_with_callbacks_and_tempfile()
|
||||
*
|
||||
* \param chain A pointer to an existing chain.
|
||||
* \param use_padding See FLAC__metadata_chain_write()
|
||||
* \param filename The filename of the new file.
|
||||
* \assert
|
||||
* \code chain != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c true if the write succeeded, else \c false. On failure,
|
||||
* check the status with FLAC__metadata_chain_status().
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__metadata_chain_write_new_file(FLAC__Metadata_Chain *chain, const char *filename, FLAC__bool use_padding);
|
||||
|
||||
/** Write all metadata out to a FLAC stream via callbacks.
|
||||
*
|
||||
* (See FLAC__metadata_chain_write() for the details on how padding is
|
||||
|
@ -1031,7 +1054,8 @@ FLAC_API FLAC__bool FLAC__metadata_chain_write_with_callbacks(FLAC__Metadata_Cha
|
|||
* FLAC file to edit, and a temporary handle to which the new FLAC
|
||||
* file will be written. It is the caller's job to move this temporary
|
||||
* FLAC file on top of the original FLAC file to complete the metadata
|
||||
* edit.
|
||||
* edit. This version of the write-with-callbacks function can also be
|
||||
* used if writing to a new file is desired anyway.
|
||||
*
|
||||
* The \a handle must be open for reading and be seekable. The
|
||||
* equivalent minimum stdio fopen() file mode is \c "r" (or \c "rb"
|
||||
|
@ -1046,8 +1070,6 @@ FLAC_API FLAC__bool FLAC__metadata_chain_write_with_callbacks(FLAC__Metadata_Cha
|
|||
* For this write function to be used, the chain must have been read with
|
||||
* FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(),
|
||||
* not FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg().
|
||||
* Also, FLAC__metadata_chain_check_if_tempfile_needed() must have returned
|
||||
* \c true.
|
||||
*
|
||||
* \param chain A pointer to an existing chain.
|
||||
* \param use_padding See FLAC__metadata_chain_write()
|
||||
|
|
2
ThirdParty/flac/include/FLAC/ordinals.h
vendored
2
ThirdParty/flac/include/FLAC/ordinals.h
vendored
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2025 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
224
ThirdParty/flac/include/FLAC/stream_decoder.h
vendored
224
ThirdParty/flac/include/FLAC/stream_decoder.h
vendored
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2025 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -235,12 +235,20 @@ typedef enum {
|
|||
* state and can no longer be used.
|
||||
*/
|
||||
|
||||
FLAC__STREAM_DECODER_UNINITIALIZED
|
||||
FLAC__STREAM_DECODER_UNINITIALIZED,
|
||||
/**< The decoder is in the uninitialized state; one of the
|
||||
* FLAC__stream_decoder_init_*() functions must be called before samples
|
||||
* can be processed.
|
||||
*/
|
||||
|
||||
FLAC__STREAM_DECODER_END_OF_LINK
|
||||
/**< The decoder has reached the end of an Ogg FLAC chain link and a new
|
||||
* link follows; FLAC__stream_decoder_finish_link() has to be called to
|
||||
* progress. This state is only returned when decoding of chained
|
||||
* streams is enabled with
|
||||
* FLAC__stream_decoder_set_decode_chained_stream()
|
||||
*/
|
||||
|
||||
} FLAC__StreamDecoderState;
|
||||
|
||||
/** Maps a FLAC__StreamDecoderState to a C string.
|
||||
|
@ -307,9 +315,14 @@ typedef enum {
|
|||
* of \c 0.
|
||||
*/
|
||||
|
||||
FLAC__STREAM_DECODER_READ_STATUS_ABORT
|
||||
FLAC__STREAM_DECODER_READ_STATUS_ABORT,
|
||||
/**< An unrecoverable error occurred. The decoder will return from the process call. */
|
||||
|
||||
FLAC__STREAM_DECODER_READ_STATUS_END_OF_LINK
|
||||
/**< The read was attempted while at the end of the link. The semantics
|
||||
* are the same as for FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM.
|
||||
*/
|
||||
|
||||
} FLAC__StreamDecoderReadStatus;
|
||||
|
||||
/** Maps a FLAC__StreamDecoderReadStatus to a C string.
|
||||
|
@ -442,9 +455,21 @@ typedef enum {
|
|||
FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM,
|
||||
/**< The decoder encountered reserved fields in use in the stream. */
|
||||
|
||||
FLAC__STREAM_DECODER_ERROR_STATUS_BAD_METADATA
|
||||
FLAC__STREAM_DECODER_ERROR_STATUS_BAD_METADATA,
|
||||
/**< The decoder encountered a corrupted metadata block. */
|
||||
|
||||
FLAC__STREAM_DECODER_ERROR_STATUS_OUT_OF_BOUNDS,
|
||||
/**< The decoder encountered a otherwise valid frame in which
|
||||
* the decoded samples exceeded the range offered by the stated
|
||||
* bit depth. */
|
||||
|
||||
FLAC__STREAM_DECODER_ERROR_STATUS_MISSING_FRAME
|
||||
/**< Two adjacent frames had frame numbers increasing by more than
|
||||
* 1 or sample numbers increasing by more than the blocksize,
|
||||
* indicating that one or more frame/frames was missing between
|
||||
* them. The decoder will sent out one or more ´fake' constant
|
||||
* subframes to fill up the gap. */
|
||||
|
||||
} FLAC__StreamDecoderErrorStatus;
|
||||
|
||||
/** Maps a FLAC__StreamDecoderErrorStatus to a C string.
|
||||
|
@ -782,6 +807,33 @@ FLAC_API void FLAC__stream_decoder_delete(FLAC__StreamDecoder *decoder);
|
|||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_set_ogg_serial_number(FLAC__StreamDecoder *decoder, long serial_number);
|
||||
|
||||
/** Set the "decode chained stream" flag. If set to \c false, the
|
||||
* decoder will stop decoding when it encounters the end-of-stream
|
||||
* of the first link in the chain. If set to \c true, decoding will
|
||||
* continue: at the start of each link, FLAC__stream_decoder_get_state
|
||||
* will return FLAC__STREAM_DECODER_SEARCH_FOR_METADATA.
|
||||
*
|
||||
* This function was made to decode chained Ogg streams, but it should
|
||||
* be possible to chain regular FLAC files through the read callback
|
||||
* by using FLAC__STREAM_DECODER_READ_STATUS_END_OF_LINK
|
||||
* appropriately.
|
||||
*
|
||||
* Note that when this flag is set to true, the serial number set
|
||||
* with FLAC__stream_decoder_set_ogg_serial_number is ignored.
|
||||
*
|
||||
* \note
|
||||
* This function has no effect with native FLAC decoding.
|
||||
*
|
||||
* \default \c false
|
||||
* \param decoder A decoder instance to set.
|
||||
* \param allow Whether to allow chained streams.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the decoder is already initialized, else \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_set_decode_chained_stream(FLAC__StreamDecoder* decoder, FLAC__bool value);
|
||||
|
||||
/** Set the "MD5 signature checking" flag. If \c true, the decoder will
|
||||
* compute the MD5 signature of the unencoded audio data while decoding
|
||||
* and compare it to the signature from the STREAMINFO block, if it
|
||||
|
@ -814,7 +866,7 @@ FLAC_API FLAC__bool FLAC__stream_decoder_set_md5_checking(FLAC__StreamDecoder *d
|
|||
* \code decoder != NULL \endcode
|
||||
* \a type is valid
|
||||
* \retval FLAC__bool
|
||||
* \c false if the decoder is already initialized, else \c true.
|
||||
* \c false if type is invalid, else \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond(FLAC__StreamDecoder *decoder, FLAC__MetadataType type);
|
||||
|
||||
|
@ -829,7 +881,7 @@ FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond(FLAC__StreamDecode
|
|||
* \code decoder != NULL \endcode
|
||||
* \code id != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the decoder is already initialized, else \c true.
|
||||
* \c false when memory allocation fails, else \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4]);
|
||||
|
||||
|
@ -841,7 +893,7 @@ FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_application(FLAC__
|
|||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the decoder is already initialized, else \c true.
|
||||
* \c always \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_all(FLAC__StreamDecoder *decoder);
|
||||
|
||||
|
@ -855,7 +907,7 @@ FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_all(FLAC__StreamDe
|
|||
* \code decoder != NULL \endcode
|
||||
* \a type is valid
|
||||
* \retval FLAC__bool
|
||||
* \c false if the decoder is already initialized, else \c true.
|
||||
* \c false if type is invalid, else \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore(FLAC__StreamDecoder *decoder, FLAC__MetadataType type);
|
||||
|
||||
|
@ -870,7 +922,7 @@ FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore(FLAC__StreamDecoder
|
|||
* \code decoder != NULL \endcode
|
||||
* \code id != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the decoder is already initialized, else \c true.
|
||||
* \c false if memory allocation fails, else \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4]);
|
||||
|
||||
|
@ -882,7 +934,7 @@ FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_application(FLAC__S
|
|||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the decoder is already initialized, else \c true.
|
||||
* \c always \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_all(FLAC__StreamDecoder *decoder);
|
||||
|
||||
|
@ -906,6 +958,17 @@ FLAC_API FLAC__StreamDecoderState FLAC__stream_decoder_get_state(const FLAC__Str
|
|||
*/
|
||||
FLAC_API const char *FLAC__stream_decoder_get_resolved_state_string(const FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Get the "decode chained stream" flag as described in
|
||||
* \code FLAC__stream_decoder_set_decode_chained_stream \endcode.
|
||||
*
|
||||
* \param decoder A decoder instance to query.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* See above.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_get_decode_chained_stream(const FLAC__StreamDecoder* decoder);
|
||||
|
||||
/** Get the "MD5 signature checking" flag.
|
||||
* This is the value of the setting, not whether or not the decoder is
|
||||
* currently checking the MD5 (remember, it can be turned off automatically
|
||||
|
@ -932,6 +995,32 @@ FLAC_API FLAC__bool FLAC__stream_decoder_get_md5_checking(const FLAC__StreamDeco
|
|||
*/
|
||||
FLAC_API FLAC__uint64 FLAC__stream_decoder_get_total_samples(const FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Seek to the end of the file being decoded to find the total number
|
||||
* of samples. This will return a number of samples even if
|
||||
* FLAC__stream_decoder_get_total_samples() returns 0. It can also
|
||||
* be used to find the total number of samples of a chained stream,
|
||||
* as it returns the total number of samples in all chain links
|
||||
* combined. See FLAC__stream_decoder_set_decode_chained_stream()
|
||||
*
|
||||
* For this function to work, the stream must be seekable. Also, as
|
||||
* seeking can fail, this function returns 0 when it was unable to
|
||||
* find the total number of samples. Use
|
||||
* FLAC__stream_decoder_get_state() in that case to find out whether
|
||||
* the decoder is still valid.
|
||||
*
|
||||
* The state in which the decoder is left after calling this function
|
||||
* is undefined and might change in the future. Use
|
||||
* FLAC__stream_decoder_reset() to return the decoder to a defined
|
||||
* state.
|
||||
*
|
||||
* \param decoder A decoder instance to query.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval uint32_t
|
||||
* See above.
|
||||
*/
|
||||
FLAC_API FLAC__uint64 FLAC__stream_decoder_find_total_samples(FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Get the current number of channels in the stream being decoded.
|
||||
* Will only be valid after decoding has started and will contain the
|
||||
* value from the most recently decoded frame header.
|
||||
|
@ -1023,6 +1112,43 @@ FLAC_API FLAC__bool FLAC__stream_decoder_get_decode_position(const FLAC__StreamD
|
|||
*/
|
||||
FLAC_API const void *FLAC__stream_decoder_get_client_data(FLAC__StreamDecoder *decoder);
|
||||
|
||||
#define FLAC__STREAM_DECODER_GET_LINK_LENGTHS_INVALID -1
|
||||
#define FLAC__STREAM_DECODER_GET_LINK_LENGTHS_NOT_INDEXED -2
|
||||
#define FLAC__STREAM_DECODER_GET_LINK_LENGTHS_MEMORY_ALLOCATION_ERROR -3
|
||||
|
||||
/** Get the link lengths in samples in a chained stream
|
||||
*
|
||||
* After either processing the whole file or using
|
||||
* FLAC__stream_decoder_find_total_samples, this function
|
||||
* returns an array with link lengths in samples. If it fails,
|
||||
* it returns a negative number as error code, currently either
|
||||
* FLAC__STREAM_DECODER_GET_LINK_LENGTHS_INVALID if the current
|
||||
* decoder is not in a valid state or not processing a chained
|
||||
* stream, FLAC__STREAM_DECODER_GET_LINK_LENGTHS_NOT_INDEXED if
|
||||
* the stream hasn't been indexed yet, and
|
||||
* FLAC__STREAM_DECODER_GET_LINK_LENGTHS_MEMORY_ALLOCATION_ERROR
|
||||
* if allocating memory failed.
|
||||
*
|
||||
* If the function succeeds, the return value is the number of
|
||||
* links. The link_lengths parameter is a FLAC__uint64 pointer
|
||||
* which is allocated by the call, and must be freed by the user.
|
||||
* If a null pointer is passed, the function only returns the
|
||||
* number of links, not their lengths. The length of the returned
|
||||
* array is equal to the number of links and thus to the return
|
||||
* value of the function.
|
||||
*
|
||||
* \param decoder A decoder instance to query.
|
||||
* \param link_lengths Address at which to return the link lengths
|
||||
* array.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval int32_t
|
||||
* \c the number of links if successful, zero or a negative
|
||||
* number if unsuccessful
|
||||
*/
|
||||
|
||||
FLAC_API int32_t FLAC__stream_decoder_get_link_lengths(FLAC__StreamDecoder *decoder, FLAC__uint64 **link_lengths);
|
||||
|
||||
/** Initialize the decoder instance to decode native FLAC streams.
|
||||
*
|
||||
* This flavor of initialization sets up the decoder to decode from a
|
||||
|
@ -1394,6 +1520,23 @@ FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_ogg_file(
|
|||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_finish(FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Finish the decoding process of the current link.
|
||||
* Checks MD5 for current link and start processing of the next link. This
|
||||
* function should only be used when the decoder state is
|
||||
* FLAC__STREAM_DECODER_END_OF_LINK. After calling this function, the state
|
||||
* is set to FLAC__STREAM_DECODER_SEARCH_FOR_METADATA.
|
||||
*
|
||||
* \param decoder An uninitialized decoder instance.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if MD5 checking is on AND a STREAMINFO block was available
|
||||
* AND the MD5 signature in the STREAMINFO block was non-zero AND the
|
||||
* signature does not match the one computed by the decoder; else
|
||||
* \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_finish_link(FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Flush the stream input.
|
||||
* The decoder's input buffer will be cleared and the state set to
|
||||
* \c FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC. This will also turn
|
||||
|
@ -1495,6 +1638,31 @@ FLAC_API FLAC__bool FLAC__stream_decoder_process_single(FLAC__StreamDecoder *dec
|
|||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_metadata(FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Decode until the end of the Ogg chain link.
|
||||
* This version instructs the decoder to decode from the current
|
||||
* position and continue until the end of link or until the
|
||||
* callbacks return a fatal error. This function should not be
|
||||
* used without enabling decoding of chained streams with
|
||||
* FLAC__stream_decoder_set_decode_chained_stream()
|
||||
*
|
||||
* To start processing the next link after calling this function,
|
||||
* call FLAC__stream_decoder_finish_link()
|
||||
*
|
||||
* As the decoder needs more input it will call the read callback.
|
||||
* As each metadata block and frame is decoded, the metadata or write
|
||||
* callback will be called with the decoded metadata or frame.
|
||||
*
|
||||
* \param decoder An initialized decoder instance.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if any fatal read, write, or memory allocation error
|
||||
* occurred (meaning decoding must stop), else \c true; for more
|
||||
* information about the decoder, check the decoder state with
|
||||
* FLAC__stream_decoder_get_state().
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_link(FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Decode until the end of the stream.
|
||||
* This version instructs the decoder to decode from the current position
|
||||
* and continue until the end of stream (the read callback returns
|
||||
|
@ -1557,6 +1725,34 @@ FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_stream(FLAC__Strea
|
|||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_skip_single_frame(FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Skip one Ogg chain link.
|
||||
* This version instructs the decoder to 'skip' the current ogg chain
|
||||
* link. This function should not be used without enabling decoding
|
||||
* of chained streams with
|
||||
* FLAC__stream_decoder_set_decode_chained_stream()
|
||||
*
|
||||
* When the location ot the next link is already known (for example,
|
||||
* because there has already been a seek in the stream) this function
|
||||
* will seek to the end of the link and start processing, but when it
|
||||
* is not, it will do various seeks (when possible) to find the end
|
||||
* of the link. If seeking is not possible (or the tell and length
|
||||
* callback do not work) it will simply read forward instead of
|
||||
* seeking, much like a muted (but faster) version of
|
||||
* FLAC__stream_decoder_process_until_end_of_link().
|
||||
*
|
||||
* \param decoder An initialized decoder instance not in a metadata
|
||||
* state.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if any fatal read, write, or memory allocation error
|
||||
* occurred (meaning decoding must stop), or when decoding a format
|
||||
* that does not support chaining, else \c true; for more
|
||||
* information about the decoder, check the decoder state with
|
||||
* FLAC__stream_decoder_get_state().
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_skip_single_link(FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Flush the input and seek to an absolute sample.
|
||||
* Decoding will resume at the given sample. Note that because of
|
||||
* this, the next write callback may contain a partial block. The
|
||||
|
@ -1566,6 +1762,14 @@ FLAC_API FLAC__bool FLAC__stream_decoder_skip_single_frame(FLAC__StreamDecoder *
|
|||
* with FLAC__stream_decoder_flush() or reset with
|
||||
* FLAC__stream_decoder_reset() before decoding can continue.
|
||||
*
|
||||
* When seeking in a chained stream with decoding of such streams
|
||||
* enabled with FLAC__stream_decoder_set_decode_chained_stream(),
|
||||
* this function seeks in the whole stream, over all links. When
|
||||
* a seek to another link is performed, the decoder will also
|
||||
* return metadata blocks of that link. If this is not desired,
|
||||
* use FLAC__stream_decoder_set_metadata_ignore_all() before
|
||||
* seeking.
|
||||
*
|
||||
* \param decoder A decoder instance.
|
||||
* \param sample The target sample number to seek to.
|
||||
* \assert
|
||||
|
|
79
ThirdParty/flac/include/FLAC/stream_encoder.h
vendored
79
ThirdParty/flac/include/FLAC/stream_encoder.h
vendored
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2025 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -288,6 +288,11 @@ typedef enum {
|
|||
extern FLAC_API const char * const FLAC__StreamEncoderStateString[];
|
||||
|
||||
|
||||
#define FLAC__STREAM_ENCODER_SET_NUM_THREADS_OK 0
|
||||
#define FLAC__STREAM_ENCODER_SET_NUM_THREADS_NOT_COMPILED_WITH_MULTITHREADING_ENABLED 1
|
||||
#define FLAC__STREAM_ENCODER_SET_NUM_THREADS_ALREADY_INITIALIZED 2
|
||||
#define FLAC__STREAM_ENCODER_SET_NUM_THREADS_TOO_MANY_THREADS 3
|
||||
|
||||
/** Possible return values for the FLAC__stream_encoder_init_*() functions.
|
||||
*/
|
||||
typedef enum {
|
||||
|
@ -533,11 +538,17 @@ typedef FLAC__StreamEncoderReadStatus (*FLAC__StreamEncoderReadCallback)(const F
|
|||
* callback is being called to write metadata.
|
||||
*
|
||||
* \note
|
||||
* Unlike when writing to native FLAC, when writing to Ogg FLAC the
|
||||
* write callback will be called twice when writing each audio
|
||||
* frame; once for the page header, and once for the page body.
|
||||
* When writing the page header, the \a samples argument to the
|
||||
* write callback will be \c 0.
|
||||
* Unlike when writing to native FLAC, when writing to Ogg FLAC the write
|
||||
* callback will be called at least twice when writing each audio frame; once
|
||||
* for the page header and once for the page body, possibly repeating this
|
||||
* pair of calls several times in a batch with the same value of
|
||||
* \a current_frame. When writing the page header, as well as in all but the
|
||||
* first page body write of the batch, the \a samples argument to the write
|
||||
* callback will be \c 0. For the write callback call containing the first
|
||||
* page body, the \a samples argument is the number of samples contained in
|
||||
* all newly added complete packets (not pages). This means that in case a
|
||||
* packet is split over two pages, they are counted in the samples argument
|
||||
* of the page on which the packet is completed.
|
||||
*
|
||||
* \note In general, FLAC__StreamEncoder functions which change the
|
||||
* state should not be called on the \a encoder while in the callback.
|
||||
|
@ -1102,6 +1113,52 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_min_residual_partition_order(FLAC__
|
|||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_encoder_set_max_residual_partition_order(FLAC__StreamEncoder *encoder, uint32_t value);
|
||||
|
||||
/** Set the maximum number of threads to use during encoding.
|
||||
* Set to a value different than 1 to enable multithreaded encoding.
|
||||
*
|
||||
* Note that enabling multithreading encoding (i.e., setting a value
|
||||
* different than 1) results in the behaviour of
|
||||
* FLAC__stream_encoder_finish(), FLAC__stream_encoder_process(),
|
||||
* FLAC__stream_encoder_process_interleaved() subtly changing.
|
||||
* For example, calling one of the process functions with enough
|
||||
* samples to fill a block might not always result in a call to
|
||||
* the write callback with a frame coding these samples. Instead,
|
||||
* blocks with samples are distributed among worker threads,
|
||||
* meaning that the first few calls to those functions will
|
||||
* return very quickly, while later calls might block if all
|
||||
* threads are occupied. Also, certain calls to the process
|
||||
* functions will results in several calls to the write callback,
|
||||
* while subsequent calls might again return very quickly with no
|
||||
* calls to the write callback.
|
||||
*
|
||||
* Also, a call to FLAC__stream_encoder_finish() blocks while
|
||||
* waiting for all threads to finish, and therefore might take much
|
||||
* longer than when not multithreading and result in multiple calls
|
||||
* to the write callback.
|
||||
*
|
||||
* Calls to the write callback are guaranteed to be in the correct
|
||||
* order.
|
||||
*
|
||||
* Currently, passing a value of 0 is synonymous with a value of 1,
|
||||
* but this might change in the future.
|
||||
*
|
||||
* \default \c 1
|
||||
* \param encoder An encoder instance to set.
|
||||
* \param value See above.
|
||||
* \assert
|
||||
* \code encoder != NULL \endcode
|
||||
* \retval uint32_t
|
||||
* - \c FLAC__STREAM_ENCODER_SET_NUM_THREADS_OK if the number of threads was set correctly,
|
||||
* - \c FLAC__STREAM_ENCODER_SET_NUM_THREADS_NOT_COMPILED_WITH_MULTITHREADING_ENABLED when
|
||||
* multithreading was not enabled at compilation,
|
||||
* - \c FLAC__STREAM_ENCODER_SET_NUM_THREADS_ALREADY_INITIALIZED when the encoder was
|
||||
* already initialized,
|
||||
* - \c FLAC__STREAM_ENCODER_SET_NUM_THREADS_TOO_MANY_THREADS when
|
||||
* the number of threads was larger than the maximum allowed number of threads (currently
|
||||
* 128).
|
||||
*/
|
||||
FLAC_API uint32_t FLAC__stream_encoder_set_num_threads(FLAC__StreamEncoder *encoder, uint32_t value);
|
||||
|
||||
/** Deprecated. Setting this value has no effect.
|
||||
*
|
||||
* \default \c 0
|
||||
|
@ -1435,6 +1492,16 @@ FLAC_API uint32_t FLAC__stream_encoder_get_min_residual_partition_order(const FL
|
|||
*/
|
||||
FLAC_API uint32_t FLAC__stream_encoder_get_max_residual_partition_order(const FLAC__StreamEncoder *encoder);
|
||||
|
||||
/** Get maximum number of threads setting.
|
||||
*
|
||||
* \param encoder An encoder instance to query.
|
||||
* \assert
|
||||
* \code encoder != NULL \endcode
|
||||
* \retval uint32_t
|
||||
* See FLAC__stream_encoder_set_num_threads().
|
||||
*/
|
||||
FLAC_API uint32_t FLAC__stream_encoder_get_num_threads(const FLAC__StreamEncoder *encoder);
|
||||
|
||||
/** Get the Rice parameter search distance setting.
|
||||
*
|
||||
* \param encoder An encoder instance to query.
|
||||
|
|
BIN
ThirdParty/libraries-debug-overlay.tar.xz
vendored
BIN
ThirdParty/libraries-debug-overlay.tar.xz
vendored
Binary file not shown.
BIN
ThirdParty/libraries.tar.xz
vendored
BIN
ThirdParty/libraries.tar.xz
vendored
Binary file not shown.
11
ThirdParty/libvgm/README.md
vendored
11
ThirdParty/libvgm/README.md
vendored
|
@ -2,12 +2,17 @@ This is verbatim from the following repository:
|
|||
|
||||
https://github.com/ValleyBell/libvgm.git
|
||||
|
||||
Built on an M1 Mac mini, using CMake from Homebrew, with the following
|
||||
Built on an M4 Mac mini, using CMake from Homebrew, with the following
|
||||
options:
|
||||
|
||||
```
|
||||
cmake .. -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" \
|
||||
-DBUILD_LIBAUDIO=NO -DBUILD_PLAYER=NO -DBUILD_VGM2WAV=NO
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_LIBAUDIO=NO -DBUILD_PLAYER=NO -DBUILD_VGM2WAV=NO
|
||||
```
|
||||
|
||||
As of this edit, commit: 82ba45d3906a0b54b6de2555468dd9e9598f617d
|
||||
And the debug overlays were made with the above, except for:
|
||||
```
|
||||
-DCMAKE_BUILD_TYPE=Debug
|
||||
```
|
||||
|
||||
As of this edit, commit: 7cad78367fa35c3f7b3ae16a296d31063cd3a7e4
|
||||
|
|
|
@ -17,5 +17,6 @@
|
|||
#define FCC_CTR_ 0x43545200 // superctr
|
||||
#define FCC_LAOO 0x4C414F4F // laoo
|
||||
#define FCC_RN22 0x524E3232 // Mao757 (RN22)
|
||||
#define FCC_EITO 0x4549544F // eito
|
||||
|
||||
#endif // __EMUCORES_H__
|
||||
|
|
|
@ -45,5 +45,5 @@
|
|||
#define DEVID_MIKEY 0x29
|
||||
#define DEVID_K007232 0x2A
|
||||
#define DEVID_K005289 0x2B
|
||||
|
||||
#define DEVID_MSM5205 0x2C // variants: MSM5205, MSM6585
|
||||
#endif // __SOUNDDEVS_H__
|
||||
|
|
|
@ -248,6 +248,7 @@ protected:
|
|||
void Cmd_GGStereo(void); // command 4F - set GameGear Stereo mask
|
||||
void Cmd_SN76489(void); // command 50 - SN76489 register write
|
||||
void Cmd_Reg8_Data8(void); // command 51/54/55/5A..5D - Register, Data (8-bit)
|
||||
void Cmd_MSM5205_Reg(void); // command 32 - MSM5205 register write (4-bit offset, 4-bit data)
|
||||
void Cmd_CPort_Reg8_Data8(void); // command 52/53/56..59/5E/5F - Port (in command byte), Register, Data (8-bit)
|
||||
void Cmd_Port_Reg8_Data8(void); // command D0..D2 - Port, Register, Data (8-bit)
|
||||
void Cmd_Ofs8_Data8(void); // command B3/B5..BB/BE/BF - Offset (8-bit), Data (8-bit)
|
||||
|
@ -281,8 +282,8 @@ protected:
|
|||
enum
|
||||
{
|
||||
_HDR_BUF_SIZE = 0x100,
|
||||
_OPT_DEV_COUNT = 0x2c,
|
||||
_CHIP_COUNT = 0x2c,
|
||||
_OPT_DEV_COUNT = 0x2d,
|
||||
_CHIP_COUNT = 0x2d,
|
||||
_PCM_BANK_COUNT = 0x40
|
||||
};
|
||||
|
||||
|
|
8
ThirdParty/ogg/README.md
vendored
8
ThirdParty/ogg/README.md
vendored
|
@ -1,10 +1,10 @@
|
|||
Build with CMake, using the following options:
|
||||
|
||||
```
|
||||
cmake .. -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.12" -DBUILD_SHARED_LIBS=ON
|
||||
cmake .. -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.12" \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=ON
|
||||
```
|
||||
|
||||
And some minor tweaks with `install_name_tool -id` to make sure that the
|
||||
resulting libogg.0.dylib referred to itself with @rpath.
|
||||
And for the debug overlay, replacing the BUILD_TYPE with `Debug`.
|
||||
|
||||
Version 1.3.5 was used.
|
||||
Version 1.3.6 was used.
|
||||
|
|
9
ThirdParty/opus/README.md
vendored
9
ThirdParty/opus/README.md
vendored
|
@ -1,13 +1,12 @@
|
|||
Build with CMake, using the following options:
|
||||
|
||||
```
|
||||
cmake .. -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.12" -DBUILD_SHARED_LIBS=ON
|
||||
cmake .. -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=ON
|
||||
```
|
||||
|
||||
And some minor tweaks with `install_name_tool -id` to make sure that the
|
||||
resulting libopus.0.dylib referred to itself with @rpath and not full
|
||||
paths of the build directory.
|
||||
The debug overlay was built the same, except with BUILD_TYPE set to `Debug`.
|
||||
|
||||
Version v1.3.1-101-g66d060c7 was used from the following repository:
|
||||
Version v1.5.2-153-g7aa5be98 was used from the following repository:
|
||||
|
||||
https://github.com/xiph/opus.git
|
||||
|
|
199
ThirdParty/opus/include/opus.h
vendored
199
ThirdParty/opus/include/opus.h
vendored
|
@ -103,7 +103,7 @@ extern "C" {
|
|||
* @endcode
|
||||
*
|
||||
* where opus_encoder_get_size() returns the required size for the encoder state. Note that
|
||||
* future versions of this code may change the size, so no assuptions should be made about it.
|
||||
* future versions of this code may change the size, so no assumptions should be made about it.
|
||||
*
|
||||
* The encoder state is always continuous in memory and only a shallow copy is sufficient
|
||||
* to copy it (e.g. memcpy())
|
||||
|
@ -198,7 +198,7 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_encoder_get_size(int channels);
|
|||
* This must be one of 8000, 12000, 16000,
|
||||
* 24000, or 48000.
|
||||
* @param [in] channels <tt>int</tt>: Number of channels (1 or 2) in input signal
|
||||
* @param [in] application <tt>int</tt>: Coding mode (@ref OPUS_APPLICATION_VOIP/@ref OPUS_APPLICATION_AUDIO/@ref OPUS_APPLICATION_RESTRICTED_LOWDELAY)
|
||||
* @param [in] application <tt>int</tt>: Coding mode (one of @ref OPUS_APPLICATION_VOIP, @ref OPUS_APPLICATION_AUDIO, or @ref OPUS_APPLICATION_RESTRICTED_LOWDELAY)
|
||||
* @param [out] error <tt>int*</tt>: @ref opus_errorcodes
|
||||
* @note Regardless of the sampling rate and number channels selected, the Opus encoder
|
||||
* can switch to a lower audio bandwidth or number of channels if the bitrate
|
||||
|
@ -222,7 +222,7 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusEncoder *opus_encoder_create(
|
|||
* This must be one of 8000, 12000, 16000,
|
||||
* 24000, or 48000.
|
||||
* @param [in] channels <tt>int</tt>: Number of channels (1 or 2) in input signal
|
||||
* @param [in] application <tt>int</tt>: Coding mode (OPUS_APPLICATION_VOIP/OPUS_APPLICATION_AUDIO/OPUS_APPLICATION_RESTRICTED_LOWDELAY)
|
||||
* @param [in] application <tt>int</tt>: Coding mode (one of OPUS_APPLICATION_VOIP, OPUS_APPLICATION_AUDIO, or OPUS_APPLICATION_RESTRICTED_LOWDELAY)
|
||||
* @retval #OPUS_OK Success or @ref opus_errorcodes
|
||||
*/
|
||||
OPUS_EXPORT int opus_encoder_init(
|
||||
|
@ -268,6 +268,42 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_encode(
|
|||
opus_int32 max_data_bytes
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
|
||||
|
||||
/** Encodes an Opus frame.
|
||||
* @param [in] st <tt>OpusEncoder*</tt>: Encoder state
|
||||
* @param [in] pcm <tt>opus_int32*</tt>: Input signal (interleaved if 2 channels) representing (or slightly exceeding) 24-bit values. length is frame_size*channels*sizeof(opus_int32)
|
||||
* @param [in] frame_size <tt>int</tt>: Number of samples per channel in the
|
||||
* input signal.
|
||||
* This must be an Opus frame size for
|
||||
* the encoder's sampling rate.
|
||||
* For example, at 48 kHz the permitted
|
||||
* values are 120, 240, 480, 960, 1920,
|
||||
* and 2880.
|
||||
* Passing in a duration of less than
|
||||
* 10 ms (480 samples at 48 kHz) will
|
||||
* prevent the encoder from using the LPC
|
||||
* or hybrid modes.
|
||||
* @param [out] data <tt>unsigned char*</tt>: Output payload.
|
||||
* This must contain storage for at
|
||||
* least \a max_data_bytes.
|
||||
* @param [in] max_data_bytes <tt>opus_int32</tt>: Size of the allocated
|
||||
* memory for the output
|
||||
* payload. This may be
|
||||
* used to impose an upper limit on
|
||||
* the instant bitrate, but should
|
||||
* not be used as the only bitrate
|
||||
* control. Use #OPUS_SET_BITRATE to
|
||||
* control the bitrate.
|
||||
* @returns The length of the encoded packet (in bytes) on success or a
|
||||
* negative error code (see @ref opus_errorcodes) on failure.
|
||||
*/
|
||||
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_encode24(
|
||||
OpusEncoder *st,
|
||||
const opus_int32 *pcm,
|
||||
int frame_size,
|
||||
unsigned char *data,
|
||||
opus_int32 max_data_bytes
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
|
||||
|
||||
/** Encodes an Opus frame from floating point input.
|
||||
* @param [in] st <tt>OpusEncoder*</tt>: Encoder state
|
||||
* @param [in] pcm <tt>float*</tt>: Input in float format (interleaved if 2 channels), with a normal range of +/-1.0.
|
||||
|
@ -357,7 +393,7 @@ OPUS_EXPORT int opus_encoder_ctl(OpusEncoder *st, int request, ...) OPUS_ARG_NON
|
|||
* error = opus_decoder_init(dec, Fs, channels);
|
||||
* @endcode
|
||||
* where opus_decoder_get_size() returns the required size for the decoder state. Note that
|
||||
* future versions of this code may change the size, so no assuptions should be made about it.
|
||||
* future versions of this code may change the size, so no assumptions should be made about it.
|
||||
*
|
||||
* The decoder state is always continuous in memory and only a shallow copy is sufficient
|
||||
* to copy it (e.g. memcpy())
|
||||
|
@ -398,6 +434,21 @@ OPUS_EXPORT int opus_encoder_ctl(OpusEncoder *st, int request, ...) OPUS_ARG_NON
|
|||
*/
|
||||
typedef struct OpusDecoder OpusDecoder;
|
||||
|
||||
/** Opus DRED decoder.
|
||||
* This contains the complete state of an Opus DRED decoder.
|
||||
* It is position independent and can be freely copied.
|
||||
* @see opus_dred_decoder_create,opus_dred_decoder_init
|
||||
*/
|
||||
typedef struct OpusDREDDecoder OpusDREDDecoder;
|
||||
|
||||
|
||||
/** Opus DRED state.
|
||||
* This contains the complete state of an Opus DRED packet.
|
||||
* It is position independent and can be freely copied.
|
||||
* @see opus_dred_create,opus_dred_init
|
||||
*/
|
||||
typedef struct OpusDRED OpusDRED;
|
||||
|
||||
/** Gets the size of an <code>OpusDecoder</code> structure.
|
||||
* @param [in] channels <tt>int</tt>: Number of channels.
|
||||
* This must be 1 or 2.
|
||||
|
@ -468,6 +519,31 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decode(
|
|||
int decode_fec
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
|
||||
|
||||
/** Decode an Opus packet.
|
||||
* @param [in] st <tt>OpusDecoder*</tt>: Decoder state
|
||||
* @param [in] data <tt>char*</tt>: Input payload. Use a NULL pointer to indicate packet loss
|
||||
* @param [in] len <tt>opus_int32</tt>: Number of bytes in payload*
|
||||
* @param [out] pcm <tt>opus_int32*</tt>: Output signal (interleaved if 2 channels) representing (or slightly exceeding) 24-bit values. length
|
||||
* is frame_size*channels*sizeof(opus_int32)
|
||||
* @param [in] frame_size Number of samples per channel of available space in \a pcm.
|
||||
* If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will
|
||||
* not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1),
|
||||
* then frame_size needs to be exactly the duration of audio that is missing, otherwise the
|
||||
* decoder will not be in the optimal state to decode the next incoming packet. For the PLC and
|
||||
* FEC cases, frame_size <b>must</b> be a multiple of 2.5 ms.
|
||||
* @param [in] decode_fec <tt>int</tt>: Flag (0 or 1) to request that any in-band forward error correction data be
|
||||
* decoded. If no such data is available, the frame is decoded as if it were lost.
|
||||
* @returns Number of decoded samples or @ref opus_errorcodes
|
||||
*/
|
||||
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decode24(
|
||||
OpusDecoder *st,
|
||||
const unsigned char *data,
|
||||
opus_int32 len,
|
||||
opus_int32 *pcm,
|
||||
int frame_size,
|
||||
int decode_fec
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
|
||||
|
||||
/** Decode an Opus packet with floating point output.
|
||||
* @param [in] st <tt>OpusDecoder*</tt>: Decoder state
|
||||
* @param [in] data <tt>char*</tt>: Input payload. Use a NULL pointer to indicate packet loss
|
||||
|
@ -511,6 +587,113 @@ OPUS_EXPORT int opus_decoder_ctl(OpusDecoder *st, int request, ...) OPUS_ARG_NON
|
|||
*/
|
||||
OPUS_EXPORT void opus_decoder_destroy(OpusDecoder *st);
|
||||
|
||||
/** Gets the size of an <code>OpusDREDDecoder</code> structure.
|
||||
* @returns The size in bytes.
|
||||
*/
|
||||
OPUS_EXPORT int opus_dred_decoder_get_size(void);
|
||||
|
||||
/** Allocates and initializes an OpusDREDDecoder state.
|
||||
* @param [out] error <tt>int*</tt>: #OPUS_OK Success or @ref opus_errorcodes
|
||||
*/
|
||||
OPUS_EXPORT OpusDREDDecoder *opus_dred_decoder_create(int *error);
|
||||
|
||||
/** Initializes an <code>OpusDREDDecoder</code> state.
|
||||
* @param[in] dec <tt>OpusDREDDecoder*</tt>: State to be initialized.
|
||||
*/
|
||||
OPUS_EXPORT int opus_dred_decoder_init(OpusDREDDecoder *dec);
|
||||
|
||||
/** Frees an <code>OpusDREDDecoder</code> allocated by opus_dred_decoder_create().
|
||||
* @param[in] dec <tt>OpusDREDDecoder*</tt>: State to be freed.
|
||||
*/
|
||||
OPUS_EXPORT void opus_dred_decoder_destroy(OpusDREDDecoder *dec);
|
||||
|
||||
/** Perform a CTL function on an Opus DRED decoder.
|
||||
*
|
||||
* Generally the request and subsequent arguments are generated
|
||||
* by a convenience macro.
|
||||
* @param dred_dec <tt>OpusDREDDecoder*</tt>: DRED Decoder state.
|
||||
* @param request This and all remaining parameters should be replaced by one
|
||||
* of the convenience macros in @ref opus_genericctls or
|
||||
* @ref opus_decoderctls.
|
||||
* @see opus_genericctls
|
||||
* @see opus_decoderctls
|
||||
*/
|
||||
OPUS_EXPORT int opus_dred_decoder_ctl(OpusDREDDecoder *dred_dec, int request, ...);
|
||||
|
||||
/** Gets the size of an <code>OpusDRED</code> structure.
|
||||
* @returns The size in bytes.
|
||||
*/
|
||||
OPUS_EXPORT int opus_dred_get_size(void);
|
||||
|
||||
/** Allocates and initializes a DRED state.
|
||||
* @param [out] error <tt>int*</tt>: #OPUS_OK Success or @ref opus_errorcodes
|
||||
*/
|
||||
OPUS_EXPORT OpusDRED *opus_dred_alloc(int *error);
|
||||
|
||||
/** Frees an <code>OpusDRED</code> allocated by opus_dred_create().
|
||||
* @param[in] dec <tt>OpusDRED*</tt>: State to be freed.
|
||||
*/
|
||||
OPUS_EXPORT void opus_dred_free(OpusDRED *dec);
|
||||
|
||||
/** Decode an Opus DRED packet.
|
||||
* @param [in] dred_dec <tt>OpusDRED*</tt>: DRED Decoder state
|
||||
* @param [in] dred <tt>OpusDRED*</tt>: DRED state
|
||||
* @param [in] data <tt>char*</tt>: Input payload
|
||||
* @param [in] len <tt>opus_int32</tt>: Number of bytes in payload
|
||||
* @param [in] max_dred_samples <tt>opus_int32</tt>: Maximum number of DRED samples that may be needed (if available in the packet).
|
||||
* @param [in] sampling_rate <tt>opus_int32</tt>: Sampling rate used for max_dred_samples argument. Needs not match the actual sampling rate of the decoder.
|
||||
* @param [out] dred_end <tt>opus_int32*</tt>: Number of non-encoded (silence) samples between the DRED timestamp and the last DRED sample.
|
||||
* @param [in] defer_processing <tt>int</tt>: Flag (0 or 1). If set to one, the CPU-intensive part of the DRED decoding is deferred until opus_dred_process() is called.
|
||||
* @returns Offset (positive) of the first decoded DRED samples, zero if no DRED is present, or @ref opus_errorcodes
|
||||
*/
|
||||
OPUS_EXPORT int opus_dred_parse(OpusDREDDecoder *dred_dec, OpusDRED *dred, const unsigned char *data, opus_int32 len, opus_int32 max_dred_samples, opus_int32 sampling_rate, int *dred_end, int defer_processing) OPUS_ARG_NONNULL(1);
|
||||
|
||||
/** Finish decoding an Opus DRED packet. The function only needs to be called if opus_dred_parse() was called with defer_processing=1.
|
||||
* The source and destination will often be the same DRED state.
|
||||
* @param [in] dred_dec <tt>OpusDRED*</tt>: DRED Decoder state
|
||||
* @param [in] src <tt>OpusDRED*</tt>: Source DRED state to start the processing from.
|
||||
* @param [out] dst <tt>OpusDRED*</tt>: Destination DRED state to store the updated state after processing.
|
||||
* @returns @ref opus_errorcodes
|
||||
*/
|
||||
OPUS_EXPORT int opus_dred_process(OpusDREDDecoder *dred_dec, const OpusDRED *src, OpusDRED *dst);
|
||||
|
||||
/** Decode audio from an Opus DRED packet with 16-bit output.
|
||||
* @param [in] st <tt>OpusDecoder*</tt>: Decoder state
|
||||
* @param [in] dred <tt>OpusDRED*</tt>: DRED state
|
||||
* @param [in] dred_offset <tt>opus_int32</tt>: position of the redundancy to decode (in samples before the beginning of the real audio data in the packet).
|
||||
* @param [out] pcm <tt>opus_int16*</tt>: Output signal (interleaved if 2 channels). length
|
||||
* is frame_size*channels*sizeof(opus_int16)
|
||||
* @param [in] frame_size Number of samples per channel to decode in \a pcm.
|
||||
* frame_size <b>must</b> be a multiple of 2.5 ms.
|
||||
* @returns Number of decoded samples or @ref opus_errorcodes
|
||||
*/
|
||||
OPUS_EXPORT int opus_decoder_dred_decode(OpusDecoder *st, const OpusDRED *dred, opus_int32 dred_offset, opus_int16 *pcm, opus_int32 frame_size);
|
||||
|
||||
/** Decode audio from an Opus DRED packet with 24-bit output.
|
||||
* @param [in] st <tt>OpusDecoder*</tt>: Decoder state
|
||||
* @param [in] dred <tt>OpusDRED*</tt>: DRED state
|
||||
* @param [in] dred_offset <tt>opus_int32</tt>: position of the redundancy to decode (in samples before the beginning of the real audio data in the packet).
|
||||
* @param [out] pcm <tt>opus_int32*</tt>: Output signal (interleaved if 2 channels). length
|
||||
* is frame_size*channels*sizeof(opus_int16)
|
||||
* @param [in] frame_size Number of samples per channel to decode in \a pcm.
|
||||
* frame_size <b>must</b> be a multiple of 2.5 ms.
|
||||
* @returns Number of decoded samples or @ref opus_errorcodes
|
||||
*/
|
||||
OPUS_EXPORT int opus_decoder_dred_decode24(OpusDecoder *st, const OpusDRED *dred, opus_int32 dred_offset, opus_int32 *pcm, opus_int32 frame_size);
|
||||
|
||||
/** Decode audio from an Opus DRED packet with floating point output.
|
||||
* @param [in] st <tt>OpusDecoder*</tt>: Decoder state
|
||||
* @param [in] dred <tt>OpusDRED*</tt>: DRED state
|
||||
* @param [in] dred_offset <tt>opus_int32</tt>: position of the redundancy to decode (in samples before the beginning of the real audio data in the packet).
|
||||
* @param [out] pcm <tt>float*</tt>: Output signal (interleaved if 2 channels). length
|
||||
* is frame_size*channels*sizeof(float)
|
||||
* @param [in] frame_size Number of samples per channel to decode in \a pcm.
|
||||
* frame_size <b>must</b> be a multiple of 2.5 ms.
|
||||
* @returns Number of decoded samples or @ref opus_errorcodes
|
||||
*/
|
||||
OPUS_EXPORT int opus_decoder_dred_decode_float(OpusDecoder *st, const OpusDRED *dred, opus_int32 dred_offset, float *pcm, opus_int32 frame_size);
|
||||
|
||||
|
||||
/** Parse an opus packet into one or more frames.
|
||||
* Opus_decode will perform this operation internally so most applications do
|
||||
* not need to use this function.
|
||||
|
@ -583,6 +766,14 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_frames(const unsigned
|
|||
*/
|
||||
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_samples(const unsigned char packet[], opus_int32 len, opus_int32 Fs) OPUS_ARG_NONNULL(1);
|
||||
|
||||
/** Checks whether an Opus packet has LBRR.
|
||||
* @param [in] packet <tt>char*</tt>: Opus packet
|
||||
* @param [in] len <tt>opus_int32</tt>: Length of packet
|
||||
* @returns 1 is LBRR is present, 0 otherwise
|
||||
* @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type
|
||||
*/
|
||||
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_has_lbrr(const unsigned char packet[], opus_int32 len);
|
||||
|
||||
/** Gets the number of samples of an Opus packet.
|
||||
* @param [in] dec <tt>OpusDecoder*</tt>: Decoder state
|
||||
* @param [in] packet <tt>char*</tt>: Opus packet
|
||||
|
|
41
ThirdParty/opus/include/opus_custom.h
vendored
41
ThirdParty/opus/include/opus_custom.h
vendored
|
@ -104,7 +104,8 @@ typedef struct OpusCustomDecoder OpusCustomDecoder;
|
|||
/** The mode contains all the information necessary to create an
|
||||
encoder. Both the encoder and decoder need to be initialized
|
||||
with exactly the same mode, otherwise the output will be
|
||||
corrupted.
|
||||
corrupted. The mode MUST NOT BE DESTROYED until the encoders and
|
||||
decoders that use it are destroyed as well.
|
||||
@brief Mode configuration
|
||||
*/
|
||||
typedef struct OpusCustomMode OpusCustomMode;
|
||||
|
@ -229,6 +230,27 @@ OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_encode(
|
|||
int maxCompressedBytes
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
|
||||
|
||||
/** Encodes a frame of audio.
|
||||
* @param [in] st <tt>OpusCustomEncoder*</tt>: Encoder state
|
||||
* @param [in] pcm <tt>opus_int32*</tt>: PCM audio in signed 32-bit format (native endian) representing (or slightly exceeding) 24-bit values.
|
||||
* There must be exactly frame_size samples per channel.
|
||||
* @param [in] frame_size <tt>int</tt>: Number of samples per frame of input signal
|
||||
* @param [out] compressed <tt>char *</tt>: The compressed data is written here. This may not alias pcm and must be at least maxCompressedBytes long.
|
||||
* @param [in] maxCompressedBytes <tt>int</tt>: Maximum number of bytes to use for compressing the frame
|
||||
* (can change from one frame to another)
|
||||
* @return Number of bytes written to "compressed".
|
||||
* If negative, an error has occurred (see error codes). It is IMPORTANT that
|
||||
* the length returned be somehow transmitted to the decoder. Otherwise, no
|
||||
* decoding is possible.
|
||||
*/
|
||||
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_encode24(
|
||||
OpusCustomEncoder *st,
|
||||
const opus_int32 *pcm,
|
||||
int frame_size,
|
||||
unsigned char *compressed,
|
||||
int maxCompressedBytes
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
|
||||
|
||||
/** Perform a CTL function on an Opus custom encoder.
|
||||
*
|
||||
* Generally the request and subsequent arguments are generated
|
||||
|
@ -325,6 +347,23 @@ OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_decode(
|
|||
int frame_size
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
|
||||
|
||||
/** Decode an opus custom frame
|
||||
* @param [in] st <tt>OpusCustomDecoder*</tt>: Decoder state
|
||||
* @param [in] data <tt>char*</tt>: Input payload. Use a NULL pointer to indicate packet loss
|
||||
* @param [in] len <tt>int</tt>: Number of bytes in payload
|
||||
* @param [out] pcm <tt>opus_int32*</tt>: Output signal (interleaved if 2 channels) representing (or slightly exceeding) 24-bit values. length
|
||||
* is frame_size*channels*sizeof(opus_int32)
|
||||
* @param [in] frame_size Number of samples per channel of available space in *pcm.
|
||||
* @returns Number of decoded samples or @ref opus_errorcodes
|
||||
*/
|
||||
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_decode24(
|
||||
OpusCustomDecoder *st,
|
||||
const unsigned char *data,
|
||||
int len,
|
||||
opus_int32 *pcm,
|
||||
int frame_size
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
|
||||
|
||||
/** Perform a CTL function on an Opus custom decoder.
|
||||
*
|
||||
* Generally the request and subsequent arguments are generated
|
||||
|
|
35
ThirdParty/opus/include/opus_defines.h
vendored
35
ThirdParty/opus/include/opus_defines.h
vendored
|
@ -169,15 +169,32 @@ extern "C" {
|
|||
#define OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST 4046
|
||||
#define OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST 4047
|
||||
#define OPUS_GET_IN_DTX_REQUEST 4049
|
||||
#define OPUS_SET_DRED_DURATION_REQUEST 4050
|
||||
#define OPUS_GET_DRED_DURATION_REQUEST 4051
|
||||
#define OPUS_SET_DNN_BLOB_REQUEST 4052
|
||||
/*#define OPUS_GET_DNN_BLOB_REQUEST 4053 */
|
||||
|
||||
/** Defines for the presence of extended APIs. */
|
||||
#define OPUS_HAVE_OPUS_PROJECTION_H
|
||||
|
||||
/* Macros to trigger compilation errors when the wrong types are provided to a CTL */
|
||||
#define __opus_check_int(x) (((void)((x) == (opus_int32)0)), (opus_int32)(x))
|
||||
|
||||
#ifdef DISABLE_PTR_CHECK
|
||||
/* Disable checks to prevent ubsan from complaining about NULL checks
|
||||
in test_opus_api. */
|
||||
#define __opus_check_int_ptr(ptr) (ptr)
|
||||
#define __opus_check_uint_ptr(ptr) (ptr)
|
||||
#define __opus_check_uint8_ptr(ptr) (ptr)
|
||||
#define __opus_check_val16_ptr(ptr) (ptr)
|
||||
#define __opus_check_void_ptr(ptr) (ptr)
|
||||
#else
|
||||
#define __opus_check_int_ptr(ptr) ((ptr) + ((ptr) - (opus_int32*)(ptr)))
|
||||
#define __opus_check_uint_ptr(ptr) ((ptr) + ((ptr) - (opus_uint32*)(ptr)))
|
||||
#define __opus_check_uint8_ptr(ptr) ((ptr) + ((ptr) - (opus_uint8*)(ptr)))
|
||||
#define __opus_check_val16_ptr(ptr) ((ptr) + ((ptr) - (opus_val16*)(ptr)))
|
||||
#define __opus_check_void_ptr(x) ((void)((void *)0 == (x)), (x))
|
||||
#endif
|
||||
/** @endcond */
|
||||
|
||||
/** @defgroup opus_ctlvalues Pre-defined values for CTL interface
|
||||
|
@ -482,7 +499,8 @@ extern "C" {
|
|||
* @param[in] x <tt>opus_int32</tt>: Allowed values:
|
||||
* <dl>
|
||||
* <dt>0</dt><dd>Disable inband FEC (default).</dd>
|
||||
* <dt>1</dt><dd>Enable inband FEC.</dd>
|
||||
* <dt>1</dt><dd>Inband FEC enabled. If the packet loss rate is sufficiently high, Opus will automatically switch to SILK even at high rates to enable use of that FEC.</dd>
|
||||
* <dt>2</dt><dd>Inband FEC enabled, but does not necessarily switch to SILK if we have music.</dd>
|
||||
* </dl>
|
||||
* @hideinitializer */
|
||||
#define OPUS_SET_INBAND_FEC(x) OPUS_SET_INBAND_FEC_REQUEST, __opus_check_int(x)
|
||||
|
@ -491,7 +509,8 @@ extern "C" {
|
|||
* @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values:
|
||||
* <dl>
|
||||
* <dt>0</dt><dd>Inband FEC disabled (default).</dd>
|
||||
* <dt>1</dt><dd>Inband FEC enabled.</dd>
|
||||
* <dt>1</dt><dd>Inband FEC enabled. If the packet loss rate is sufficiently high, Opus will automatically switch to SILK even at high rates to enable use of that FEC.</dd>
|
||||
* <dt>2</dt><dd>Inband FEC enabled, but does not necessarily switch to SILK if we have music.</dd>
|
||||
* </dl>
|
||||
* @hideinitializer */
|
||||
#define OPUS_GET_INBAND_FEC(x) OPUS_GET_INBAND_FEC_REQUEST, __opus_check_int_ptr(x)
|
||||
|
@ -618,6 +637,18 @@ extern "C" {
|
|||
* @hideinitializer */
|
||||
#define OPUS_GET_PREDICTION_DISABLED(x) OPUS_GET_PREDICTION_DISABLED_REQUEST, __opus_check_int_ptr(x)
|
||||
|
||||
/** If non-zero, enables Deep Redundancy (DRED) and use the specified maximum number of 10-ms redundant frames
|
||||
* @hideinitializer */
|
||||
#define OPUS_SET_DRED_DURATION(x) OPUS_SET_DRED_DURATION_REQUEST, __opus_check_int(x)
|
||||
/** Gets the encoder's configured Deep Redundancy (DRED) maximum number of frames.
|
||||
* @hideinitializer */
|
||||
#define OPUS_GET_DRED_DURATION(x) OPUS_GET_DRED_DURATION_REQUEST, __opus_check_int_ptr(x)
|
||||
|
||||
/** Provide external DNN weights from binary object (only when explicitly built without the weights)
|
||||
* @hideinitializer */
|
||||
#define OPUS_SET_DNN_BLOB(data, len) OPUS_SET_DNN_BLOB_REQUEST, __opus_check_void_ptr(data), __opus_check_int(len)
|
||||
|
||||
|
||||
/**@}*/
|
||||
|
||||
/** @defgroup opus_genericctls Generic CTLs
|
||||
|
|
80
ThirdParty/opus/include/opus_multistream.h
vendored
80
ThirdParty/opus/include/opus_multistream.h
vendored
|
@ -143,7 +143,7 @@ extern "C" {
|
|||
* <a href="https://www.xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-810004.3.9">Vorbis
|
||||
* channel ordering</a>. A decoder may wish to apply an additional permutation
|
||||
* to the mapping the encoder used to achieve a different output channel
|
||||
* order (e.g. for outputing in WAV order).
|
||||
* order (e.g. for outputting in WAV order).
|
||||
*
|
||||
* Each multistream packet contains an Opus packet for each stream, and all of
|
||||
* the Opus packets in a single multistream packet must have the same
|
||||
|
@ -382,6 +382,44 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode(
|
|||
opus_int32 max_data_bytes
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
|
||||
|
||||
/** Encodes a multistream Opus frame.
|
||||
* @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state.
|
||||
* @param[in] pcm <tt>const opus_int32*</tt>: The input signal as interleaved
|
||||
* samples representing (or slightly exceeding) 24-bit values.
|
||||
* This must contain
|
||||
* <code>frame_size*channels</code>
|
||||
* samples.
|
||||
* @param frame_size <tt>int</tt>: Number of samples per channel in the input
|
||||
* signal.
|
||||
* This must be an Opus frame size for the
|
||||
* encoder's sampling rate.
|
||||
* For example, at 48 kHz the permitted values
|
||||
* are 120, 240, 480, 960, 1920, and 2880.
|
||||
* Passing in a duration of less than 10 ms
|
||||
* (480 samples at 48 kHz) will prevent the
|
||||
* encoder from using the LPC or hybrid modes.
|
||||
* @param[out] data <tt>unsigned char*</tt>: Output payload.
|
||||
* This must contain storage for at
|
||||
* least \a max_data_bytes.
|
||||
* @param [in] max_data_bytes <tt>opus_int32</tt>: Size of the allocated
|
||||
* memory for the output
|
||||
* payload. This may be
|
||||
* used to impose an upper limit on
|
||||
* the instant bitrate, but should
|
||||
* not be used as the only bitrate
|
||||
* control. Use #OPUS_SET_BITRATE to
|
||||
* control the bitrate.
|
||||
* @returns The length of the encoded packet (in bytes) on success or a
|
||||
* negative error code (see @ref opus_errorcodes) on failure.
|
||||
*/
|
||||
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode24(
|
||||
OpusMSEncoder *st,
|
||||
const opus_int32 *pcm,
|
||||
int frame_size,
|
||||
unsigned char *data,
|
||||
opus_int32 max_data_bytes
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
|
||||
|
||||
/** Encodes a multistream Opus frame from floating point input.
|
||||
* @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state.
|
||||
* @param[in] pcm <tt>const float*</tt>: The input signal as interleaved
|
||||
|
@ -510,7 +548,7 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSDecoder *opus_multistream_decoder_crea
|
|||
int *error
|
||||
) OPUS_ARG_NONNULL(5);
|
||||
|
||||
/** Intialize a previously allocated decoder state object.
|
||||
/** Initialize a previously allocated decoder state object.
|
||||
* The memory pointed to by \a st must be at least the size returned by
|
||||
* opus_multistream_encoder_get_size().
|
||||
* This is intended for applications which use their own allocator instead of
|
||||
|
@ -591,6 +629,44 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode(
|
|||
int decode_fec
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
|
||||
|
||||
/** Decode a multistream Opus packet.
|
||||
* @param st <tt>OpusMSDecoder*</tt>: Multistream decoder state.
|
||||
* @param[in] data <tt>const unsigned char*</tt>: Input payload.
|
||||
* Use a <code>NULL</code>
|
||||
* pointer to indicate packet
|
||||
* loss.
|
||||
* @param len <tt>opus_int32</tt>: Number of bytes in payload.
|
||||
* @param[out] pcm <tt>opus_int32*</tt>: Output signal, with interleaved
|
||||
* samples representing (or slightly exceeding) 24-bit values.
|
||||
* This must contain room for
|
||||
* <code>frame_size*channels</code>
|
||||
* samples.
|
||||
* @param frame_size <tt>int</tt>: The number of samples per channel of
|
||||
* available space in \a pcm.
|
||||
* If this is less than the maximum packet duration
|
||||
* (120 ms; 5760 for 48kHz), this function will not be capable
|
||||
* of decoding some packets. In the case of PLC (data==NULL)
|
||||
* or FEC (decode_fec=1), then frame_size needs to be exactly
|
||||
* the duration of audio that is missing, otherwise the
|
||||
* decoder will not be in the optimal state to decode the
|
||||
* next incoming packet. For the PLC and FEC cases, frame_size
|
||||
* <b>must</b> be a multiple of 2.5 ms.
|
||||
* @param decode_fec <tt>int</tt>: Flag (0 or 1) to request that any in-band
|
||||
* forward error correction data be decoded.
|
||||
* If no such data is available, the frame is
|
||||
* decoded as if it were lost.
|
||||
* @returns Number of samples decoded on success or a negative error code
|
||||
* (see @ref opus_errorcodes) on failure.
|
||||
*/
|
||||
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode24(
|
||||
OpusMSDecoder *st,
|
||||
const unsigned char *data,
|
||||
opus_int32 len,
|
||||
opus_int32 *pcm,
|
||||
int frame_size,
|
||||
int decode_fec
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
|
||||
|
||||
/** Decode a multistream Opus packet with floating point output.
|
||||
* @param st <tt>OpusMSDecoder*</tt>: Multistream decoder state.
|
||||
* @param[in] data <tt>const unsigned char*</tt>: Input payload.
|
||||
|
|
77
ThirdParty/opus/include/opus_projection.h
vendored
77
ThirdParty/opus/include/opus_projection.h
vendored
|
@ -260,6 +260,44 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_encode(
|
|||
opus_int32 max_data_bytes
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
|
||||
|
||||
/** Encodes a projection Opus frame.
|
||||
* @param st <tt>OpusProjectionEncoder*</tt>: Projection encoder state.
|
||||
* @param[in] pcm <tt>const opus_int32*</tt>: The input signal as interleaved
|
||||
* samples representing (or slightly exceeding) 24-bit values.
|
||||
* This must contain
|
||||
* <code>frame_size*channels</code>
|
||||
* samples.
|
||||
* @param frame_size <tt>int</tt>: Number of samples per channel in the input
|
||||
* signal.
|
||||
* This must be an Opus frame size for the
|
||||
* encoder's sampling rate.
|
||||
* For example, at 48 kHz the permitted values
|
||||
* are 120, 240, 480, 960, 1920, and 2880.
|
||||
* Passing in a duration of less than 10 ms
|
||||
* (480 samples at 48 kHz) will prevent the
|
||||
* encoder from using the LPC or hybrid modes.
|
||||
* @param[out] data <tt>unsigned char*</tt>: Output payload.
|
||||
* This must contain storage for at
|
||||
* least \a max_data_bytes.
|
||||
* @param [in] max_data_bytes <tt>opus_int32</tt>: Size of the allocated
|
||||
* memory for the output
|
||||
* payload. This may be
|
||||
* used to impose an upper limit on
|
||||
* the instant bitrate, but should
|
||||
* not be used as the only bitrate
|
||||
* control. Use #OPUS_SET_BITRATE to
|
||||
* control the bitrate.
|
||||
* @returns The length of the encoded packet (in bytes) on success or a
|
||||
* negative error code (see @ref opus_errorcodes) on failure.
|
||||
*/
|
||||
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_encode24(
|
||||
OpusProjectionEncoder *st,
|
||||
const opus_int32 *pcm,
|
||||
int frame_size,
|
||||
unsigned char *data,
|
||||
opus_int32 max_data_bytes
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
|
||||
|
||||
|
||||
/** Encodes a projection Opus frame from floating point input.
|
||||
* @param st <tt>OpusProjectionEncoder*</tt>: Projection encoder state.
|
||||
|
@ -405,7 +443,7 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusProjectionDecoder *opus_projection_decod
|
|||
) OPUS_ARG_NONNULL(5);
|
||||
|
||||
|
||||
/** Intialize a previously allocated projection decoder state object.
|
||||
/** Initialize a previously allocated projection decoder state object.
|
||||
* The memory pointed to by \a st must be at least the size returned by
|
||||
* opus_projection_decoder_get_size().
|
||||
* This is intended for applications which use their own allocator instead of
|
||||
|
@ -493,6 +531,43 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_decode(
|
|||
int decode_fec
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
|
||||
|
||||
/** Decode a projection Opus packet.
|
||||
* @param st <tt>OpusProjectionDecoder*</tt>: Projection decoder state.
|
||||
* @param[in] data <tt>const unsigned char*</tt>: Input payload.
|
||||
* Use a <code>NULL</code>
|
||||
* pointer to indicate packet
|
||||
* loss.
|
||||
* @param len <tt>opus_int32</tt>: Number of bytes in payload.
|
||||
* @param[out] pcm <tt>opus_int32*</tt>: Output signal, with interleaved
|
||||
* samples representing (or slightly exceeding) 24-bit values.
|
||||
* This must contain room for
|
||||
* <code>frame_size*channels</code>
|
||||
* samples.
|
||||
* @param frame_size <tt>int</tt>: The number of samples per channel of
|
||||
* available space in \a pcm.
|
||||
* If this is less than the maximum packet duration
|
||||
* (120 ms; 5760 for 48kHz), this function will not be capable
|
||||
* of decoding some packets. In the case of PLC (data==NULL)
|
||||
* or FEC (decode_fec=1), then frame_size needs to be exactly
|
||||
* the duration of audio that is missing, otherwise the
|
||||
* decoder will not be in the optimal state to decode the
|
||||
* next incoming packet. For the PLC and FEC cases, frame_size
|
||||
* <b>must</b> be a multiple of 2.5 ms.
|
||||
* @param decode_fec <tt>int</tt>: Flag (0 or 1) to request that any in-band
|
||||
* forward error correction data be decoded.
|
||||
* If no such data is available, the frame is
|
||||
* decoded as if it were lost.
|
||||
* @returns Number of samples decoded on success or a negative error code
|
||||
* (see @ref opus_errorcodes) on failure.
|
||||
*/
|
||||
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_decode24(
|
||||
OpusProjectionDecoder *st,
|
||||
const unsigned char *data,
|
||||
opus_int32 len,
|
||||
opus_int32 *pcm,
|
||||
int frame_size,
|
||||
int decode_fec
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
|
||||
|
||||
/** Decode a projection Opus packet with floating point output.
|
||||
* @param st <tt>OpusProjectionDecoder*</tt>: Projection decoder state.
|
||||
|
|
19
ThirdParty/opusfile/README.md
vendored
19
ThirdParty/opusfile/README.md
vendored
|
@ -1,13 +1,22 @@
|
|||
Build with CMake, using the following options:
|
||||
|
||||
```
|
||||
cmake .. -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.12" -DBUILD_SHARED_LIBS=ON
|
||||
env PATH=/usr/local/bin:$PATH cmake -B build-x86 -DCMAKE_LIBRARY_PATH=/usr/local/lib \
|
||||
-DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=ON -DOP_DISABLE_HTTP=ON -DOP_DISABLE_DOCS=ON
|
||||
cmake build-arm -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=ON -DOP_DISABLE_HTTP=ON \
|
||||
-DOP_DISABLE_DOCS=ON
|
||||
```
|
||||
|
||||
And some minor tweaks with `install_name_tool -id` to make sure that the
|
||||
resulting libopusfile.0.dylib referred to itself with @rpath and not full
|
||||
paths of the build directory.
|
||||
The debug overlay was built the same, except with BUILD_TYPE set to `Debug`.
|
||||
|
||||
Version v0.12-38-gcf218fb was used from the following repository:
|
||||
The CMakeCache.txt also needed hacking to replace the libopus with our own build for compatible version
|
||||
numbers in the import.
|
||||
|
||||
Finally, `install_name_tool -change` was needed to change the import path for libogg. The version
|
||||
numbers were already compatible.
|
||||
|
||||
Version v0.12-51-g24d6e75 was used from the following repository:
|
||||
|
||||
https://github.com/xiph/opusfile.git
|
||||
|
|
2
ThirdParty/opusfile/include/opusfile.h
vendored
2
ThirdParty/opusfile/include/opusfile.h
vendored
|
@ -1816,7 +1816,7 @@ void op_set_decode_callback(OggOpusFile *_of,
|
|||
#define OP_TRACK_GAIN (3008)
|
||||
|
||||
/**Gain offset type that indicates that the provided offset should be used as
|
||||
the gain directly, without applying any the header or track gains.*/
|
||||
the gain directly, without applying any of the header or track gains.*/
|
||||
#define OP_ABSOLUTE_GAIN (3009)
|
||||
|
||||
/**Sets the gain to be used for decoded output.
|
||||
|
|
Loading…
Reference in a new issue