This paper presents an automatic algorithm to extract the discrete phrase and accent commands with their timing parameters from the speech wave. This algorithm is based on dynamic programming (also called DP algorithm) and least square error methods. The DP algorithm is composed of two steps. First, it decides the timing of the phrase commands; then, it determines the suitable parameters of phrase and accent commands. Finally, the experiment results of one example will be shown.