public uint Estimate(DataSourceVersion2Command command) { Debug.Assert(_sampleCount == 160 || _sampleCount == 240); (float baseCost, float costPerSample) = GetCostByFormat(_sampleCount, command.SampleFormat, command.SrcQuality); return((uint)(baseCost + (costPerSample * (((command.SampleRate / 200.0f) / _sampleCount) * (command.Pitch * 0.000030518f) - 1.0f)))); }
/// <summary> /// Create a new <see cref="DataSourceVersion2Command"/>. /// </summary> /// <param name="voiceState">The <see cref="VoiceState"/> to generate the command from.</param> /// <param name="state">The <see cref="VoiceUpdateState"/> to generate the command from.</param> /// <param name="outputBufferIndex">The output buffer index to use.</param> /// <param name="channelIndex">The target channel index.</param> /// <param name="nodeId">The node id associated to this command.</param> public void GenerateDataSourceVersion2(ref VoiceState voiceState, Memory <VoiceUpdateState> state, ushort outputBufferIndex, ushort channelIndex, int nodeId) { DataSourceVersion2Command command = new DataSourceVersion2Command(ref voiceState, state, outputBufferIndex, channelIndex, nodeId); command.EstimatedProcessingTime = _commandProcessingTimeEstimator.Estimate(command); AddCommand(command); }
public uint Estimate(DataSourceVersion2Command command) { return(0); }