The wavenumber integration method is considered to be the most accurate algorithm of arbitrary horizontally stratified media in computational ocean acoustics. Compared with normal modes, it contains not only the discrete spectrum of the wavenumber but also the components of the continuous spectrum, eliminating errors in the model approximation for horizontally stratified media. Traditionally, analytical and semianalytical methods have been used to solve the depthseparated wave equation of the wavenumber integration method, and numerical solutions have generally focused on the finite difference method and the finite element method. In this paper, an algorithm for solving the depth equation with the Chebyshev-Tau spectral method combined with the domain decomposition strategy is proposed, and a numerical program named WISpec is developed accordingly. The algorithm can simulate both the sound field excited by a point source and the sound field excited by a line source. The key idea of the algorithm is first to discretize the depth equations of each layer by using the Chebyshev-Tau spectral method and then to solve the equations of each layer simultaneously by combining boundary and interface conditions. Several representative numerical experiments are devised to test the accuracy of 'WISpec'. The high consistency of the results of different models running under the same configuration proves that the numerical algorithm proposed in this paper is accurate, reliable, and numerically stable.