/// <summary>
    /// Call this function to create geometry handle
    /// </summary>
    void CreatePropagationGeometry()
    {
        AudioConfiguration config = AudioSettings.GetConfiguration();

        // Create Geometry
        if (PropIFace.CreateAudioGeometry(out geometryHandle) != OSPSuccess)
        {
            throw new Exception("Unable to create geometry handle");
        }

        // Upload Mesh
        if (filePath != null && filePath.Length != 0 && fileEnabled && Application.isPlaying)
        {
            if (!ReadFile())
            {
                Debug.Log("Failed to read file, attempting to regenerate audio geometry");

                // We should not try to upload data dynamically if data already exists
                UploadGeometry();
            }
        }
        else
        {
            UploadGeometry();
        }
    }
    //***********************************************************************
    // WriteFile - Write the serialized mesh file.

    public bool WriteFile()
    {
        if (filePath == null || filePath.Length == 0)
        {
            Debug.Log("Invalid mesh file path");
            return(false);
        }

        AudioConfiguration config = AudioSettings.GetConfiguration();

        // Create a temporary geometry.
        IntPtr tempGeometryHandle = IntPtr.Zero;

        if (PropIFace.CreateAudioGeometry(out tempGeometryHandle) != OSPSuccess)
        {
            throw new Exception("Unable to create temp geometry handle");
        }

        // Upload the mesh geometry.
        if (uploadMesh(tempGeometryHandle, gameObject, gameObject.transform.worldToLocalMatrix, false) != OSPSuccess)
        {
            Debug.Log("Error uploading mesh " + gameObject.name);
            return(false);
        }

        // Write the mesh to a file.
        if (PropIFace.AudioGeometryWriteMeshFile(tempGeometryHandle, filePath) != OSPSuccess)
        {
            Debug.Log("Error writing mesh file " + filePath);
            return(false);
        }

        // Destroy the geometry.
        PropIFace.DestroyAudioGeometry(tempGeometryHandle);

        Debug.Log("Write mesh file " + filePath);
        return(true);
    }