Let $G$ be a compact group.
Let $\sigma$ be a continuous involution of $G$. In this paper, we are concerned by the following functional equation
$$\int\limits_{G}{f\left( xty{{t}^{-1}} \right)dt}\,+\int\limits_{G}{f\left( xt\sigma \left( y \right){{t}^{-1}} \right)dt}=2g\left( x \right)h\left( y \right),\,\,\,x,y\in G,$$
where $f,g,h:G\mapsto \mathbb{C}$, to be determined, are complex continuous functions on $G$ such that $f$ is central. This equation generalizes d’Alembert's and Wilson's functional equations. We show that the solutions are expressed by means of characters of irreducible, continuous and unitary representations of the group $G$.