Bristol, set your torpedoes to magnetic and just under the draft of the escorts. Wait until they are as close as 500 meters then fire. Too far out and you'll usually miss. And use torpedoes that you can set to max speed.
Acoustic torpedoes work great. BUT remember to stop your own engines or you'll be toast.

If you have Duds checked in the Options, then you'll lose a few torpedoes that way.
I used to sink the escorts first and then go after the cargo ships. Once all torpedoes were used I'd surface and use the deck gun. BUT again, be careful of ships shooting back at you. Look closely and check for deck guns on them before you surface.