| 1550 | } |
| 1551 | |
| 1552 | void WaveOAL::ApplyPitch() |
| 1553 | { |
| 1554 | // _pitchRatio is a pitch ratio (1.0 = native rate). Mimic 1.99 |
| 1555 | // Wave8::SetFrequency exactly: map the ratio to the DirectSound |
| 1556 | // absolute-rate clamp [100, 100000] Hz against the sample's native |
| 1557 | // rate, not a naive [0.5, 2.0] ratio clamp — otherwise a low-RPM |
| 1558 | // engine sound is floored at 0.5x and vehicles jump straight to |
| 1559 | // "full rev" with no startup spin-up. |
| 1560 | if (_alSource && _state.frequency > 0 && _pitchRatio > 0.f) |
| 1561 | { |
| 1562 | alSourcef(_alSource, AL_PITCH, DX8::dsoundPitchRatio(_pitchRatio, _state.frequency)); |
| 1563 | } |
| 1564 | } |
| 1565 | |
| 1566 | void WaveOAL::SetVolume(float v, float freq, bool /*immediate*/) |
| 1567 | { |
| 1568 | _volume = v; |
| 1569 | |
| 1570 | // Remember the requested pitch so DoPlay re-applies it when the source |
| 1571 | // (re)starts — 1.99 stores _frequencySet and reapplies it on play |
no outgoing calls
no test coverage detected