public StreamedBufferSoundSource(SoundInstanceStreamedBuffer instance, MediaSynchronizer synchronizer, string mediaDataUrl, long startPosition, long length) : base(instance, NumberOfBuffers, MaxBufferSizeBytes) { mediaSynchronizer = synchronizer; this.mediaDataUrl = mediaDataUrl; this.startPosition = startPosition; this.length = length; NewSources.Enqueue(this); }
//========================================================================================== /// <summary> /// Initializes a new instance of the <see cref="CompressedSoundSource"/> class. /// This type of DynamicSoundSource is streamed from Disk and reads compressed Celt encoded data, used internally. /// </summary> /// <param name="instance">The associated SoundInstance</param> /// <param name="fileProvider">The file provider to read the stream from</param> /// <param name="soundStreamUrl">The compressed stream internal URL</param> /// <param name="numberOfPackets">The number of packets</param> /// <param name="sampleRate">The sample rate of the compressed data</param> /// <param name="channels">The number of channels of the compressed data</param> /// <param name="maxCompressedSize">The maximum size of a compressed packet</param> public CompressedSoundSource(SoundInstance instance, IVirtualFileProvider fileProvider, string soundStreamUrl, int numberOfPackets, int numberOfSamples, int sampleRate, int channels, int maxCompressedSize) : base(instance, NumberOfBuffers, SamplesPerBuffer * MaxChannels * sizeof(short)) { looped = instance.IsLooping; this.channels = channels; this.maxCompressedSize = maxCompressedSize; this.fileProvider = fileProvider; this.soundStreamUrl = soundStreamUrl; this.sampleRate = sampleRate; this.numberOfPackets = numberOfPackets; this.samples = numberOfSamples; playRange = new PlayRange(TimeSpan.Zero, TimeSpan.Zero); NewSources.Enqueue(this); }