I have read and learnt in many places that velocity of a wave depends only on the medium through which it travels. It is clear from this that the velocity of a wave doesn't depend on the frequency of the wave because both the sound of a roaring lion and crying baby reaches our ear with the same speed. But we also know that $\text{speed} = \frac{\text{distance}}{\text{time}}\ \Rightarrow\ v=\frac{\lambda}{T}\ \Rightarrow\ v=\lambda f=\text{wavelength}\times\text{frequency}$. In this derivation, velocity is found to be dependent on frequency.
Can anyone please explain this contradiction? Is there any fault in my perception of the concept?