I played this game when I was a kid so I probably misremember some of the details. What I do remember is that this boy wakes up and gets this enchanted book as a gift or something and throughout the game you make choices whether to use a spell in different scenarios or not.
I remember there's a huge talking book in a room and either you're the one that causes it or you deal with it because you're scared it's gonna eat you. In almost every encounter you choose between two options, to use magic or not. All of that would impact the ending you'd see at last. I'm pretty sure there's no other interactivity beyond that. It really played like a movie in that sense.
I also remember the boy being captured by space pirates at one point and their ship being close to being devoured by a black hole. I think the boy had long brown hair, maybe in a ponytail? His eyes were light, limegreen maybe. The man that gave the boy the magic book hadn't seen his wife in forever and in the game you meet her on some beach. They look exactly alike, just different clothing. I think, depending on your choices, you can make sure they reunite in the end.
The whole game's in 3d but obviously not very good so I'd guess the game's from 2000-2007. I think the game ended with every main character singing a song together in harmony. It might have also ended with the boy waking up and realizing it was all a dream.