Trailing-edge serrations inspired by owls are capable of reducing broadband noise. In this study, the wall-resolved large-eddy simulations (LES) are carried out on the flow over NACA-0012 airfoil with additional serrated trailing edges. The computations are conducted with the high-order flux reconstruction method on unstructured meshes. Three kinds of serrations with different lengths are studied and compared with the straight trailing-edge case, and all three types of serration achieved a certain degree of noise reduction. Presently, the medium-length serration achieves the best noise reduction effect. The maximum decrease of overall sound pressure level is approximately 2.4 dB, implying that the length of serration has a substantial impact on the noise reduction effect. The serration has no significant effect on the upstream turbulence statistics, but it changes the flow structure near the serration, such as inducing side vortex pairs attached to the serration edges. Moreover, dynamic mode decomposition shows that the pressure structures vary with the serration length. For the most unstable hydrodynamic wave, the spanwise coherence of the mode structure of pressure in the upstream boundary layer is weakened. In addition, serrations can redistribute the dipole sources on the surfaces of airfoil and serrations. The destructive interference is enhanced to some extent, which is favourable for noise reduction. In contrast with LES simulations, the pure dipole analysis shows that the longest serration case seems to be the best. Furthermore, a recently developed noise theory is used to evaluate the influence of serrations on the flow noise sources qualitatively and quantitatively. It is found that the serrations can mitigate noise source intensity near the serration edges but increase the source intensity in the near wake. The combined effect of serration on the dipole source and flow noise source determines the overall noise reduction effect. To conclude, destructive interference plays a primary role in suppressing noise radiation by serrated trailing edges, and the dual effect of flow noise sources should be considered in future serration designs. As the influence of turbulence structure will make it more difficult to find the optimal serration parameters, the position of high-fidelity simulation will become increasingly important.