Exemplo n.º 1
0
 public MFFileWriter(string path, ThroughputDescription description) : base(path, description)
 {
     // We always need to write using the same thread for MediaFoundation to function properly
     thread = new Thread(DoWork);
     thread.Start();
     dataProcessedEvent.WaitOne();
 }
Exemplo n.º 2
0
        public SampleBuffer(ThroughputDescription desc, float length)
        {
            buffers = new BufferedWaveProvider[desc.Count];
            for (int i = 0; i < desc.Count; i++)
            {
                buffers[i] = new BufferedWaveProvider(desc[i].WaveFormat)
                {
                    BufferDuration = TimeSpan.FromSeconds(length)
                };
            }

            description = desc;
        }
Exemplo n.º 3
0
        public FileWriter(string path, ThroughputDescription description)
        {
            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }

            encoders = new T[description.Count];
            for (int i = 0; i < description.Count; i++)
            {
                encoders[i] = GetEncoder(Path.Combine(path, description[i].Name), description[i].WaveFormat);
            }

            this.description = description;
        }
Exemplo n.º 4
0
 public WavFileWriter(string path, ThroughputDescription description) : base(path, description)
 {
 }