Gravitational resonance spectroscopy consists in measuring the energy spectrum of bouncing ultracold neutrons above a mirror by inducing resonant transitions between different discrete quantum levels. We discuss how to induce the resonances with a flow through arrangement in the GRANIT spectrometer, excited by an oscillating magnetic field gradient. The spectroscopy could be realized in two distinct modes (so called DC and AC) using the same device to produce the magnetic excitation. We present calculations demonstrating the feasibility of the newly proposed AC mode.