{"record":{"id":"c6007e66ba1b877a","repo":"EllanJiang/GameFramework","slug":"play-sound-info-is-invalid","errorCode":null,"errorMessage":"Play sound info is invalid.","messagePattern":"Play sound info is invalid\\.","errorType":"exception","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Sound/SoundManager.cs","lineNumber":619,"sourceCode":"        public void ResumeSound(int serialId, float fadeInSeconds)\n        {\n            foreach (KeyValuePair<string, SoundGroup> soundGroup in m_SoundGroups)\n            {\n                if (soundGroup.Value.ResumeSound(serialId, fadeInSeconds))\n                {\n                    return;\n                }\n            }\n\n            throw new GameFrameworkException(Utility.Text.Format(\"Can not find sound '{0}'.\", serialId));\n        }\n\n        private void LoadAssetSuccessCallback(string soundAssetName, object soundAsset, float duration, object userData)\n        {\n            PlaySoundInfo playSoundInfo = (PlaySoundInfo)userData;\n            if (playSoundInfo == null)\n            {\n                throw new GameFrameworkException(\"Play sound info is invalid.\");\n            }\n\n            if (m_SoundsToReleaseOnLoad.Contains(playSoundInfo.SerialId))\n            {\n                m_SoundsToReleaseOnLoad.Remove(playSoundInfo.SerialId);\n                if (playSoundInfo.PlaySoundParams.Referenced)\n                {\n                    ReferencePool.Release(playSoundInfo.PlaySoundParams);\n                }\n\n                ReferencePool.Release(playSoundInfo);\n                m_SoundHelper.ReleaseSoundAsset(soundAsset);\n                return;\n            }\n\n            m_SoundsBeingLoaded.Remove(playSoundInfo.SerialId);\n\n            PlaySoundErrorCode? errorCode = null;","sourceCodeStart":601,"sourceCodeEnd":637,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Sound/SoundManager.cs#L601-L637","documentation":"LoadAssetSuccessCallback is invoked by the ResourceManager when a sound asset finishes loading; its userData must be a PlaySoundInfo created by PlaySound. If the cast yields null (null or wrong userData), the internal contract between PlaySound and the load callback is broken and this GameFrameworkException is thrown.","triggerScenarios":"The resource layer invoking m_LoadAssetCallbacks with null userData, or PlaySoundInfo.Create returning null (e.g. ReferencePool exhausted/misused); internal misuse of m_LoadAssetCallbacks by custom code.","commonSituations":"Custom code reusing the manager's LoadAssetCallbacks with different userData; ReferencePool corruption from releasing objects twice; framework version mismatch where PlaySoundInfo layout changed.","solutions":["Do not reuse SoundManager's private LoadAssetCallbacks for your own LoadAsset calls.","Ensure PlaySoundInfo objects are only released through ReferencePool once (never double-release).","If this occurs stock, verify GameFramework and GameFramework.Unity versions match and rebuild.","Add a null check on PlaySoundInfo.Create arguments if customizing PlaySound internally."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try\n{\n    soundManager.PlaySound(assetName, groupName, priority);\n}\ncatch (GameFrameworkException ex)\n{\n    Debug.LogError($\"PlaySound internal failure: {ex.Message}\");\n}","preventionTips":["Never pass custom callbacks into SoundManager internals.","Follow strict ReferencePool Create/Release pairing for PlaySoundInfo.","Keep GameFramework and Unity wrapper assemblies from the same build."],"tags":["sound","gameframework","internal","callback"],"backgroundTag":"internal-invariant-violation","analyzedSha":"d0c010b05167c58e92350449d04864a91ca13fd2","analyzedAt":"2026-09-15T13:37:15.352Z","contentChangedAt":"2026-09-15T13:37:15.352Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}