In the first stanza, the speaker assumes the tapping "Tis some visitor...tapping at my chamber door." He is surprised to hear the tapping because it is late at night ("a midnight dreary"), it is cold outside due to the time of year ("the bleak December"), and he wasn't expecting any visitor or visitors under those circumstances.
Finally opening the door, the speaker finds noone awaiting admission. Perplexed by this development ("wondering, fearing,
Doubting, dreaming dreams no mortal ever dared to dream before"), the speaker retreats back into his chambers in confusion. When the tapping resumes, he concludes that he is hearing something blowing against the window ("something at my window lattice") instead of being a human visitor at the door. This, of course, is what is happening. When he flings open the window shutter, the Raven enters the room.
At first he thinks it is a visitor at his chamber door. Then he thinks that the wind is hitting his window. Then he sees the raven.