Exemple #1
0
        public PpmProvider(byte channels, PpmProfile ppmProfile, int sampleRate)
        {
            ChannelsCount = channels;
            _ppmProfile   = ppmProfile;
            _waveFormat   = new WaveFormat(sampleRate, 1);

            _playingBuffer = new byte[channels];
            _writingBuffer = new byte[channels];

            _lock = new object();

            _currentChannel       = 0;
            _currentChannelSample = 0;
            _totalSamples         = 0;

            _pauseSamples = (int)(_ppmProfile.PauseDuration / 1000000.0 * _waveFormat.SampleRate);

            TakeNextChannel();
        }
Exemple #2
0
 public PpmProvider(byte channels, PpmProfile ppmProfile) : this(channels, ppmProfile, 44100)
 {
 }
 /// <summary>
 /// Create new PpmGenerator object
 /// </summary>
 /// <param name="channelsCount">Number of channels in signal</param>
 /// <param name="ppmProfile">PPM profile for using transmitter</param>
 /// <param name="device">Selected output device</param>
 public PpmGenerator(byte channelsCount, PpmProfile ppmProfile, MMDevice device)
 {
     _provider = new PpmProvider(channelsCount, ppmProfile);
     _player   = new  WasapiOut(device, AudioClientShareMode.Shared, false, 30);
     _player.Init(_provider);
 }