コード例 #1
0
 protected override void Setup()
 {
     frame->NbSamples    = sampleCount;
     frame->Format       = (int)format.SampleFormat;
     frame->ExtendedData = (byte **)&frame->Data;
     FF.av_samples_fill_arrays(frame->ExtendedData, frame->Linesize, (byte *)cache, format.Channels, sampleCount, format.SampleFormat, 1);
 }
コード例 #2
0
        public void Resize(int sampleCount)
        {
            if (format == null)
            {
                throw new InvalidOperationException($"{nameof(AudioFrame)} 对象未指定格式");
            }

            this.sampleCount = sampleCount;
            int bytes = format.GetBytes(sampleCount);

            cache.Resize(bytes);
            FF.av_samples_fill_arrays(datas, null, cache.data, format.Channels, sampleCount, format.SampleFormat, 1);
        }