We have several examples of the Lord speaking to David through Gad and Nathan.  Let’s look at just a couple of them to show the legitimacy of your good question.

2 Samuel 7:4-5, “And it came to pass that night, that the word of the LORD came unto Nathan, saying, Go and tell my servant David, Thus saith the LORD, Shalt thou build me an house for me to dwell in?”

2 Samuel 24:11-13, “For when David was up in the morning, the word of the LORD came unto the prophet Gad, David’s seer, saying, Go and say unto David, Thus saith the LORD, I offer thee three things; choose thee one of them, that I may do it unto thee. So Gad came to David, and told him, and said unto him, Shall seven years of famine come unto thee in thy land? or wilt thou flee three months before thine enemies, while they pursue thee? or that there be three days’ pestilence in thy land? now advise, and see what answer I shall return to him that sent me.”

Let’s consider the words of Hebrews 1:1-2, “God, who at sundry times and in divers manners spake in time past unto the fathers by the prophets, Hath in these last days spoken unto us by his Son, whom he hath appointed heir of all things, by whom also he made the worlds.”  We see that the Lord chose to speak to His people in the Old Testament through His appointed prophets.  These men received their messages from the Lord in different ways, such as dreams, visions, the direct voice of God, etc.  2 Peter 1:21 says, “For the prophecy came not in old time by the will of man: but holy men of God spake as they were moved by the Holy Ghost.”  These prophets were considered ‘holy men of God’ and spoke only when prompted by the Lord with a message for His people or an individual.  Luke 1:70 tells us that the Lord, “…spake by the mouth of his holy prophets…” 

This principle of speaking to His people through His prophets is borne out in the scriptures in many places.  2 Kings 17:13 is one example.  That says, “Yet the LORD testified against Israel, and against Judah, by all the prophets, and by all the seers, saying, Turn ye from your evil ways, and keep my commandments and my statutes, according to all the law which I commanded your fathers, and which I sent to you by my servants the prophets.”  God sent prophets throughout history to guide and warn His people. So very often, they turned their backs and didn’t follow the Lord’s instructions and warnings.  The Lord said to Jeremiah in Jeremiah 7:25-26, “Since the day that your fathers came forth out of the land of Egypt unto this day I have even sent unto you all my servants the prophets, daily rising up early and sending them: Yet they hearkened not unto me, nor inclined their ear, but hardened their neck: they did worse than their fathers.”  The Lord Jesus at one point said to the scribes and Pharisees, “…ye are the children of them which killed the prophets.” (Matthew 23:31).  The Lord, in love and mercy, often sought to warn and guide His people by using His holy prophets.  Israel historically rejected, dismissed, and killed the prophets of the Lord.

There were times when the Lord saw fit to speak directly to men.  Men such as Adam (Genesis 2:16-17), Moses (Exodus 3:4-5), Joshua (Joshua 1:1-2), and Samuel (1 Samuel 3:10).  He even spoke directly to David when He chose to, as we read in 1 Samuel 23:2, “Therefore David inquired of the LORD, saying, Shall I go and smite these Philistines? And the LORD said unto David, Go, and smite the Philistines, and save Keilah.”  (Many writers believe that in this instance, the Lord spoke to David through Gad, His prophet.)  How does the Lord speak to us today?  Hebrews 1:2 tells us the Lord, “Hath in these last days spoken unto us by his Son, whom he hath appointed heir of all things, by whom also he made the worlds.”  God speaks to us through the person of His Son.  To hear His voice, we simply need to prayerfully read God’s Word and allow the Lord to speak to us through His Word by His Spirit.  (407.4)