They have a database of music on a computer or server that they tap in to, no need to pay for a third party service or stream lower quality audio from YouTube.
In the past they played directly from CD’s or audio cassettes.
Oh and how it’s decided – they can set up playlists (useful for those “90s at Noon” hours where they play 90s songs), play it at random, or manually select (useful for shows where they take requests).
Latest Answers