The next time you’re feeling pain, you might want to hold off on taking that aspirin. According to a new study, music therapy could be the way to go instead.

A study, published in Frontiers in Pain Research, found that subjects listening to music experienced less pain than control subjects. The researchers used “thermal stimuli” on the subjects’ upper arms, simulating pain they described as like “a hot cup of coffee held against the skin,” adding that participants were at no risk of physical harm.

What the subjects were listening to made a difference too.

“We compared two different types of music: relaxing music that was taken from a music therapy application that’s been proved to be effective in prior studies, and self-selected preferred music,” noted study coauthor Mathieu Roy, PhD, an associate professor of psychology at McGill University in Montreal.

“Listening to music activates various regions of the brain, mainly the auditory cortex (located in the temporal lobes), which is critical for processing incoming auditory information,” explained Psychology Today.

“The effects generally range between a 10 to 20 percent reduction, so similar to anti-inflammatory drugs, for instance. The mechanism of how it works is different, but the amplitude of the effects appears to be comparable,” the study concluded.

According to the study, “pain is a significant societal and individual burden, and there is a need for alternative ways to relieve it without over-reliance on pharmacological analgesics, which may produce side effects and dependencies.”

Previous studies have suggested music can also help reduce blood pressure, and improve sleep quality, memory and mental alertness, according to John Hopkins Medicine.