Mass Loaded Vinyl (MLV) is a versatile and successful soundproofing product for windows, made out of PVC and vinyl which has a major product like barium sulphate or calcium carbonate. A straightforward method to seal these gaps would be to fill them using an acoustic caulk, for example Green Glue https://acoustic-windows25702.blog-kids.com/39157197/acoustic-secondary-glazing-for-dummies