Function encode_adpcm_ima

Source
pub fn encode_adpcm_ima(sample_value: i16, state: &mut AdpcmImaState) -> u8
Expand description

Encodes a linear 16-bit signed integer sample value to a 4-bit encoded IMA ADPCM value.

The state parameter should be initialized to zero or to values from the audio stream (depending on how the format has specified it). This method updates state with new values. Subsequent calls should pass in the state values from the previous call.