Freezing and Audio skips continuously on the person's last sound
So I have a Macbook Air mid-2012 and this is the second time where the whole computer freezes and the audio skips continuously on the person's in the audio last letter that he/she says. I tried doing apple hardware diagnostics and it says that there is no issues. Usually during the freezing the keyboard and trackpad are unresponsive. It then hard restarts on its own loosing my work that I've been working on. This happened to me the first time when i was playing music on spotify and the second time when I was watching a video on NY times.
MacBook Air, OS X Yosemite (10.10)