有人指出 NAudio 可能允许我这样做。但是,如果它不能,我会感谢可以的图书馆的建议。我目前在 C#/WPF 中工作,但很乐意调用其他 C/C++ 库。
我正在接收音频样本的连续缓冲区(单声道)。类型:16 位有符号整数。速率:16 kHz。我需要保存 1-2 小时的缓冲数据 (230 MB)。我想将此缓冲区保存到磁盘,以便以后检索它。
需要能够在仍然捕获的同时播放此缓冲区的一部分,例如:
@0s, Buffer.StartRecording()
@30s, handle = Buffer.Play(20,25) //Plays the buffer from 20 - 25 s
@50s, handle1 = Buffer.Play(20,25)
@51s, handle2 = Buffer.Play(20,25) //Playing two parts of the buffer at the same time.
@52s, handle1.Stop() //Buffer1 stops playing after having played for 2 seconds.
我应该能够开始播放尚未完成编写的声音:
@0s, Buffer.StartRecording()
@25s, handle = Buffer.Play(20,30) //Plays the buffer from 20 - 30 s
@30s, //Buffer has played halfway through (currently, play marker is at 25 s
@35s, //Buffer playing finishes.
需要能够屏蔽部分播放缓冲区,例如:
bufferMaskStep = 1 //seconds
bufferMask = [1, 0, 0.5, 1, 0.1] //the volumes at each time step
Buffer.Play(20, 25, bufferMask, bufferMaskStep)
我看到 NAudio 提供WaveStream
,但显然WaveStream.Write
不支持。我可以自己管理附加到一个字节缓冲区,并在我想播放它们时从其中复制部分,但我想知道是否有一个开箱即用的解决方案。
我正在做的事情的要点是制作一个循环踏板。