Dialogue is speech, regardless of whether its from a human, a rabbit, or a pepper pot.
Your example would be formatted: Bang, bang, bang the rapid fire cannon hurled.
I'd like to say it's pretty horrible, but that is an opinion and not a statement that I can support with evidence.
Your instincts of using physical elements to make your narrative more immersive are on the right track. Using your example, a rapid fire cannon would go bang, bang, bang. And your instincts to avoid writing like I just did are also good because it's boring.
A cliche way to express might be
- 'the rapid fire cannon belched fire'
- 'the rapid fire cannon birthed death and fire'
but I think the idea of using sensation as a verb is effective. Rewording your example 'the rapid fire cannon banged, banged, banged on without pause, all through the battle' or 'the rapid fire cannon boomed and banged and paused, then did it all again.'
Obviously, I'm not putting a great deal of thought into the sentences since they are only to impart an idea.
Or you could describe the sensation of the pressure wave, assuming your character is near the rapid firing cannon. Or, if the character is far away, describe the flash of light and the rumble. Or, if your character is the target of the cannon fire, describe the impacts of the shells: you can feel it through the ground, the sound, the pressure, the sound of shrapnel whizzing through the air, trees exploding and splintering when struck by shells.
The more physical sensations you can evoke the more your reader's imaginations will build the scenes in their mind's eye.