What's the difference meaning between these two sentences


Alberto oyo la musical de la fiesta y Salio de casa.

Alberto oia la musical de la fiesta cuando Salio de casa.

The first sentence suggests that Alberto heard the music and then left the house, while the second sentence implies that Alberto was already hearing the music when he left the house.

The difference in meaning between these two sentences lies in the tense and the relationship between the actions described.

1. "Alberto oyó la música de la fiesta y salió de casa."
In this sentence, both actions (hearing the music and leaving the house) are described in the past tense. It implies that Alberto heard the music, and as a separate action, he left the house. There is no direct connection between the two actions other than their occurrence in the past.

2. "Alberto oía la música de la fiesta cuando salió de casa."
In this sentence, there is a temporal relationship between the two actions. The first action, "oía la música de la fiesta" (he was hearing the music), is described in the imperfect tense, indicating an ongoing or continuous action in the past. The second action, "salió de casa" (he left the house), is described in the preterite tense, indicating a completed action that interrupts the ongoing action. This sentence implies that Alberto was hearing the music when suddenly he left the house.