Coupling of cavity modes and guiding modes in two-dimensional phononic crystals