If it is making the noise when the car is stationary and in neutral try pressing the clutch, if the noise goes away it is likely to be the gearbox, it not it is likely not the gearbox. Pressing the clutch disengages the engine from the gearbox so the gearbox internals stop rotating and any noises it is making should go away.