Q. Dear Rabbi,
I’m going to be going on a very long (about 1000 mile) drive for business during the three weeks – during the nine days in fact. I find it difficult to drive such a long distance without listening to music. Although I have many hours of shiurim to listen to, I fear that many hours of this will make me drowsy and unable to drive. Having music in the background will make it easier. Is there any dispensation in halacha for listening to music under these circumstances?

A. A. Listening to music during the three weeks is prohibited when done for joy and pleasure, and not when other unrelated intentions are involved, such as teaching or involuntary listening when shopping etc.. Igros Moshe (O.H. 3: 87) permits teaching instrumental music when it is done as a professional duty and not for enjoyment, See Naharos Eisan (p. 252) in regards to permitting singing and playing music for children in school.
See question 104 on someone who hears music to help him with his necessary jogging.
We wrote; “There are Poiskim who permit listening to music that is not played for the sake of enjoyment or pleasure, as one who employs workers that listen to the radio as they work, or music that is played for a child to calm him to sleep. (Nitey Gavriel , Bein Hametzorim ch. 15, 8-13). Some Poiskim understand the music prohibition as only what conduces to joy and dancing, and permit classical music, played for soothing and comforting the soul. (Shoalin Vedorshim p. 245).
However many hold music in the three weeks to be a prohibition by itself. Mikdash Isroel (Bein Hametzorim 7-23) addresses this specific question of playing music while exercising, and prohibits even when done for health reasons. His reasoning is, that for the short period involved (at least during the nine days), it could be and should be avoided, in honour and remembrance of the churban Bais Hamikdosh.
Horav Shlomo Miller’s Shlit’a, point of view is that it is preferable to follow this last opinion.”
See also question 1401 on the permitted listening to music at the phone when on hold.
In your particular case, when the awakening music while driving can be a lifesaver, Horav Shlomo Miller’s Shlit’a opinion is that it is permitted. The Rov suggested to listen to epic, vibrant but not necessarily happy music, (if you like it).

Rabbi A. Bartfeld as revised by Horav Shlomo Miller Shlit’a