My question is straightforward. Does the Sorting Hat speak only to the person wearing it, or to the Great Hall? Did all of the students hear it say,
"Not Slytherin, eh?"
when Harry used it?
The Sorting Hat can whisper.
"Not Slytherin, eh?" said the small voice. "Are you sure? ... Well, if you're sure---better be GRYFFINDOR!"
Harry heard the hat shout the last word to the whole hall.
Harry Potter and the Sorcerer's Stone. "The Sorting Hat;" emphasis added
So, the Sorting Hat holds conversations much like a normal person. It can modulate its voice for a personal remark or shout for the whole hall to hear.
I don't think it's ever clearly described. In the movies, at least, you can see the hat move its lips to shout 'Slytherin' etc. I'd assume if the hat were moving its lips whilst whispering (which I can't seem to find in the book at all, other than references to 'a small voice' in Harry's ear) people would notice. I've always assumed that the hat can telepathically communicate with the person it's placed on, because the person, in turn, doesn't whisper anything back, but think their answer.
So I guess my answer is it can do both: it can speak (sing the beginning song and shout the house), but it can also communicate by thought.
The Sorting Hat was muttering in Harry’s ear when he was discussing where to put him. He only yelled his final choice out loud for everyone else to hear, so no one else would have heard the rest of the discussion between them before Harry’s house was chosen but Harry.
“Every year, this aged old hat, patched, frayed and dirty, sorted new students into the four Hogwarts houses (Gryffindor, Hufflepuff, Ravenclaw and Slytherin). Harry well remembered putting it on, exactly one year ago, and waiting, petrified, for its decision as it muttered aloud in his ear.”
- Harry Potter and the Chamber of Secrets, Chapter 5 (The Whomping Willow)
This also would be how the Hat handles every student’s Sorting. When Harry is paying attention to figure out how the Sorting works, he notices that the Hat takes different amounts of time before yelling out their house, but he doesn’t notice any talking before that. So no one else would have heard the Hat say “Not Slytherin, eh?” or anything after that until he yelled “GRYFFINDOR!”.
“Sometimes, Harry noticed, the hat shouted out the house at once, but at others it took a little while to decide. ‘Finnigan, Seamus’, the sandy-haired boy next to Harry in the line, sat on the stool for almost a whole minute before the hat declared him a Gryffindor.”
- Harry Potter and the Philosopher's Stone, Chapter 7 (The Sorting Hat)
It seems very likely from what we know that the Sorting Hat has these muttered conversations with every student he sorts, and only yells when he’s chosen their house. This seems logical, so the students wouldn’t have the whole Great Hall hearing what the Sorting Hat thinks of them.