Acquire audio and send UDP acquisition parts

I need to acquire a sound through a USB microphone, capture the sound for 5 seconds and save the hex stream in a vector.

You can completely forget doing this exactly as stated.

You will NOT be using a collector that can change size.

So, you need to start with defining a collector, usually an array, of the maximum size needed. What IS that maximum size, and what type should the collector be, and does your Arduino have enough room to have two of them?

You seem to think that you will be able to send a UDP packet containing all that data, in the time between two samples, so you don't miss a sample. Do you REALLY believe that that is possible? I certainly do not.