ma_linear_resamplerresampler;/* For doppler effect. */
floatdopplerPitch;/* Will be updated by ma_spatializer_process_pcm_frames() and can be used by higher level functions to apply a pitch shift for doppler effect. */
floatoldPitch;/* For determining whether or not the resampler needs to be updated to reflect the new pitch. The resampler will be updated on the mixing thread. */
floatoldPitch;/* For determining whether or not the resampler needs to be updated to reflect the new pitch. The resampler will be updated on the mixing thread. */
floatoldDopplerPitch;/* For determining whether or not the resampler needs to be updated to take a new doppler pitch into account. */
ma_bool8isPitchDisabled;/* When set to true, pitching will be disabled which will allow the resampler to be bypassed to save some computation. */
ma_bool8isPitchDisabled;/* When set to true, pitching will be disabled which will allow the resampler to be bypassed to save some computation. */
ma_bool8isSpatializationDisabled;/* Set to false by default. When set to false, will not have spatialisation applied. */
ma_bool8isSpatializationDisabled;/* Set to false by default. When set to false, will not have spatialisation applied. */
We need a resampler for doppler effect. We don't run anything through the resampler when the
doppler factor is 0, but we still want to initialize it in case the caller changes the factor
dynamically later on.
*/
resamplerConfig=ma_linear_resampler_config_init(ma_format_f32,pConfig->channelsIn,1,1);/* We don't care about rates. We'll dynamically adjust it based on a ratio. */
ma_convert_pcm_frames_channels_f32((float*)pFramesOut,pSpatializer->config.channelsOut,pChannelMapOut,(constfloat*)pFramesIn,pSpatializer->config.channelsIn,pChannelMapIn,frameCount);/* Safe casts to float* because f32 is the only supported format. */
ma_convert_pcm_frames_channels_f32((float*)pFramesOut,pSpatializer->config.channelsOut,pChannelMapOut,(constfloat*)pFramesIn,pSpatializer->config.channelsIn,pChannelMapIn,frameCount);/* Safe casts to float* because f32 is the only supported format. */
}
}
/*
We're not doing attenuation so don't bother with doppler for now. I'm not sure if this is
the correct thinking so might need to review this later.
*/
pSpatializer->dopplerPitch=1;
}else{
}else{
/*
/*
Let's first determine which listener the sound is closest to. Need to keep in mind that we
Let's first determine which listener the sound is closest to. Need to keep in mind that we