Yes, it's the APU. Engines are never running idle at the gate (except prior to power pushbacks - using reverse thrust). If you hear it while boarding the plane, it's the APU. Engines sound less whiny and 'roar' a bit more. But once taxiing, the elec. power source is engine generators, so the APU is OFF and you'll be hearing the engines. On some aircraft you can notice the spool-down sound from APU shutdown.
I recall that once a 727's APU was started while I was boarding the plane from the back, and it was a deafening loud whine