I may not be understanding the source of your difficulty. There are three facts here.
First, the speed, frequency and wavelength are related as $v = \lambda \nu$.
Second, the frequency of light remains the same when crossing the interfaces between media. This is a consequence of ensuring that the continuity conditions implied by Maxwell's equations are satisfied across the interface. If there were a frequency change, there could be no fixed phase relationship between time-varying fields either side of the boundary, so (for example) the tangential components of the E-fields and H-fields could not be continuous. If this is your problem, then your question is a duplicate of Why doesn't the frequency of light change during refraction?
Third, the speed of light is slower, by a factor $\sqrt{\mu_r \epsilon_r}$, in a material with relative permeabilities or permittivities greater than unity. Again, this is a simple consequence of solving Maxwell's equations in media with finite polarisation and/or magnetisation. See for example
Why does larger permittivity of a medium cause light to propagate slower?
If you accept these three facts then the behaviour of light as it crosses from one medium to another is not mysterious. The speed is not constant, therefore there isn't an inverse relation between the frequency and wavelength. The frequency is constant, therefore the speed and wavelength are proportional.
Because the frequency of a sound wave is defined as "the number of waves per second."
If you had a sound source emitting, say, 200 waves per second, and your ear (inside a different medium) received only 150 waves per second, the remaining waves 50 waves per second would have to pile up somewhere — presumably, at the interface between the two media.
After, say, a minute of playing the sound, there would already be 60 × 50 = 3,000 delayed waves piled up at the interface, waiting for their turn to enter the new medium. If you stopped the sound at that point, it would still take 20 more seconds for all those piled-up waves to get into the new medium, at 150 waves per second. Thus, your ear, inside the different medium, would continue to hear the sound for 20 more seconds after it had already stopped.
We don't observe sound piling up at the boundaries of different media like that. (It would be kind of convenient if it did, since we could use such an effect for easy sound recording, without having to bother with microphones and record discs / digital storage. But alas, it just doesn't happen.) Thus, it appears that, in the real world, the frequency of sound doesn't change between media.
Besides, imagine that you switched the media around: now the sound source would be emitting 150 waves per second, inside the "low-frequency" medium, and your ear would receive 200 waves per second inside the "high-frequency" medium. Where would the extra 50 waves per second come from? The future? Or would they just magically appear from nowhere?
All that said, there are physical processes that can change the frequency of sound, or at least introduce some new frequencies. For example, there are materials that can interact with a sound wave and change its shape, distorting it so that an originally pure single-frequency sound wave acquires overtones at higher frequencies.
These are not, however, the same kinds of continuous shifts as you'd observe with wavelength, when moving from one medium to another with a different speed of sound. Rather, the overtones introduced this way are generally multiples (or simple fractions) of the original frequency: you can easily obtain overtones at two or three or four times the original frequency, but not at, say, 1.018 times the original frequency. This is because they're not really changing the rate at which the waves cycle, but rather the shape of each individual wave (which can be viewed as converting some of each original wave into new waves with two/three/etc. times the original frequency).
Best Answer
The frequency of a sound wave will stay the same when sound passes from one medium to another because each compression or rarefaction in the first medium will produced exactly one compression or rarefaction in the second medium. Typically the speed of a wave depends mainly on the properties of the medium so in this case speed and wavelength would change while the frequency stays constant.
A number of sound sources produce specific frequencies based on standing waves in some medium - for example most musical instruments or the human voice. When we want to change these frequencies we typically change the length of the resonating system, say by effectively shortening a guitar string or sliding a trombone to change the length of an air column. In that case the medium is unchanged (except for length) meaning the speed of the sound is fixed. In this case as the wavelength changes the frequency changes as the speed stays constant.
As for a case where the wavelength would stay constant while the frequency and speed change consider tuning a guitar. The wavelength is determined by the length of the string which is constant but the tension of the string changes which changes the speed of the wave. This results in a changing frequency. Drums can be tuned in a similar way by adjusting the tensing in the drum skin. In some drums, for example the tabla, the tension in the drumskin is manipulated while playing to change the frequency of the sound.