Help in starting and stopping record in right place

starting to record music and we keep getting long blank spaces before and after song has been played. Is there a way to set it up to start recording when first song starts and end when it is through playing? I am brand new to Audacity and would be thankful for any help I could get.

It’s good to have space at each end of a recording. It allows you to trim the ends neatly without having nasty clicks and bumps at the start / end.