Here "in their ears" means the people themselves. Alternate translation: "so that I may speak the words of this song to them" (See: [[rc://en/ta/man/translate/figs-synecdoche]])
Possible meanings are 1) Moses is calling on all those who live in heaven and earth to be witnesses to what he says or 2) Moses is speaking to heaven and earth as if they are people, and he is calling them to be witnesses to what he says. A similar phrase appears in [Deuteronomy 30:19](../30/19.md). (See: [[rc://en/ta/man/translate/figs-metonymy]] and [[rc://en/ta/man/translate/figs-personification]] and [[rc://en/ta/man/translate/figs-apostrophe]])