The first line should outside anything.
The remaining can be outisde anything if you can access to the music or in a awake function.
In any case, it must not be in an update. Otherwise, you would subscribe to the event too many times.
Also, when you get some errors, make you sure to show them. It will help find the solution to the problem ;)