'Sound continues after tab close in pyqt5

I'm making a web browser using pyqt5 just for fun and I have seen that when I close a tab the audio that was playing in that tab continue plays until I quit the browser. Any ideas how to fix that?

Edit:

def close_current_tab(self, i):

        if self.tabs.count() < 2:
            return

        self.tabs.removeTab(i)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source