there should be a valve on the fuel rail that you can plug a pressure gauge on if you have one. when the pump doesn't turn on while you crank, you need to know if power is at the pump at that time. if it has power, and no pumpy, then the pump is bad.
but if it isn't getting power when not coming on, something else. now, hearing it come on, and not starting still could be pump if it isn't pumping enough pressure, since it sounds like its been on the way out. also good idea to replace fuel filter if its old, to rule out clogged filter when the pump is coming on.
also check grounds, and relay for when it doesn't come on. hopefully they're both the same problem, just a bad/weak fuel pump. good luck. oh yeah, welcome to the forum.
good idea to check spark when it doesn't start, eventhough it sounds like just fuel related.