コード例 #1
0
        public AdpcmDataSourceCommandVersion1(ref Server.Voice.VoiceState serverState, Memory <VoiceUpdateState> state, ushort outputBufferIndex, int nodeId)
        {
            Enabled = true;
            NodeId  = nodeId;

            OutputBufferIndex = outputBufferIndex;
            SampleRate        = serverState.SampleRate;
            Pitch             = serverState.Pitch;

            WaveBuffers = new WaveBuffer[RendererConstants.VoiceWaveBufferCount];

            for (int i = 0; i < WaveBuffers.Length; i++)
            {
                ref Server.Voice.WaveBuffer voiceWaveBuffer = ref serverState.WaveBuffers[i];

                WaveBuffers[i] = voiceWaveBuffer.ToCommon(1);
            }
コード例 #2
0
        public PcmFloatDataSourceCommandVersion1(ref Server.Voice.VoiceState serverState, Memory <VoiceUpdateState> state, ushort outputBufferIndex, ushort channelIndex, int nodeId)
        {
            Enabled = true;
            NodeId  = nodeId;

            OutputBufferIndex = (ushort)(channelIndex + outputBufferIndex);
            SampleRate        = serverState.SampleRate;
            ChannelIndex      = channelIndex;
            ChannelCount      = serverState.ChannelsCount;
            Pitch             = serverState.Pitch;

            WaveBuffers = new WaveBuffer[Constants.VoiceWaveBufferCount];

            for (int i = 0; i < WaveBuffers.Length; i++)
            {
                ref Server.Voice.WaveBuffer voiceWaveBuffer = ref serverState.WaveBuffers[i];

                WaveBuffers[i] = voiceWaveBuffer.ToCommon(1);
            }
コード例 #3
0
        public DataSourceVersion2Command(ref Server.Voice.VoiceState serverState, Memory <VoiceUpdateState> state, ushort outputBufferIndex, ushort channelIndex, int nodeId)
        {
            Enabled      = true;
            NodeId       = nodeId;
            ChannelIndex = channelIndex;
            ChannelCount = serverState.ChannelsCount;
            SampleFormat = serverState.SampleFormat;
            SrcQuality   = serverState.SrcQuality;
            CommandType  = GetCommandTypeBySampleFormat(SampleFormat);

            OutputBufferIndex = (ushort)(channelIndex + outputBufferIndex);
            SampleRate        = serverState.SampleRate;
            Pitch             = serverState.Pitch;

            WaveBuffers = new WaveBuffer[Constants.VoiceWaveBufferCount];

            for (int i = 0; i < WaveBuffers.Length; i++)
            {
                ref Server.Voice.WaveBuffer voiceWaveBuffer = ref serverState.WaveBuffers[i];

                WaveBuffers[i] = voiceWaveBuffer.ToCommon(2);
            }