public void FillWithPcm(IPcmData pcm)
                {
                    this.pcm_ = pcm;

                    var channels       = pcm.Channels;
                    var bytesPerSample = pcm.BytesPerSample;
                    var format         = PcmHelperOpenTk.GetPcmFormat(channels, bytesPerSample);

                    var bytes = pcm.Pcm;

                    AL.BufferData(this.Id,
                                  format,
                                  bytes,
                                  bytes.Length,
                                  pcm.SampleRate);
                }
Exemple #2
0
            public AudioComponent(IAudio audio)
            {
                this.pcm_ =
                    new OggLoader().Load(
                        LocalIo.Resources.GetFile("music/lobbyBackAndForth.ogg"));

                this.streamPopulator_ = new RateStreamPopulator(this.pcm_);

                var factory = audio.Factory;

                //this.source_ = factory.NewAudioSource();
                //this.buffer_ = factory.NewAudioBuffer();

                //this.buffer_.FillWithPcm(this.pcm_);

                //this.source_.Play(this.buffer_, true);

                this.source_ = factory.NewAudioStreamSource(
                    this.streamPopulator_.Populate,
                    this.pcm_.Channels,
                    this.pcm_.BytesPerSample,
                    this.pcm_.SampleRate);
                this.source_.Play(true);
            }
Exemple #3
0
 public RateStreamPopulator(IPcmData pcm)
 {
     this.pcm_          = pcm;
     this.sampleOffset_ =
         new CircularRangedFloat(0, 0, this.pcm_.SampleCount);
 }
Exemple #4
0
 public ForwardStreamPopulator(IPcmData pcm)
 {
     this.pcm_ = pcm;
 }