我使用mic_stream来获取麦克风的实时值。
我使用一个监听器
listener = stream.listen((samples) => currentSamples = samples);
currentSamples的输出是
[0, -12, -12, 0, 7, 0, 0, -32, -52, -52, -62, -72, -62, -72, -72, -62, -72, -82, -62, -92, -92, -112, -102, -82, -52, -42, -52, -32, -32, -52, -32, -42, -42, -52, -52, -52, -62, -52, -62, -62, -62, -62, -52, -52, -22, -22, 0, 27, 37, 67, 67, 67, 47, 37, 27, 7, 27, 37, 27, 37, 37, 37, 27, 7, 0, 7, 0, 7, 17, 7, 0, -12, -22, -32, -32, -42, -32, -32, -32, 0, -12, 0, 0, -22, -12, -22, -22, -22, -22, -22, -12, -12, -22, -12, 0, -12, 0, 0, 0, 0, 0, 7, 17, 0, 0, 0, 0, 7, 0, 0, -12, 0, 7, 0, 27, 7, 7, 0, 0, 0, 0, 0, 0, 0, 7, 7, -12, 0, 0, -12, 0, 0, -12, 0, -22, -32, -32, -22, 0, -22, -12, -12, -22, -32, -22, -32, -12, 0, 0, 0, -42, -32, -52, -52, -52, -62, -32, -32, -22, -12, -22, -12, -12, -22, -42, 0, 0, 0, 7, 17, 27, 17, 37, 27, 17, 0, 17, 37, 17, 27, 17, 17, 7, 17, 0, 0, 0, -12, 7, 0, -12, -22, -52, -32, -42, -62, -52, -52, -42, -32, -32, -32, -42, -72, -92, -82, -132, -112, -92, -122, -102, -102, -82, -72, -42, -52, -72, -52, -42, -12, 0, 0, 17, 37, 37, 27, 47, 47, 47, 37, 67, 87, 77, 77, 87, 77, 77, 97, 77, 87
现在,我想播放currentSamples
的音频,换句话说,我想播放List<int>
的音频,但是我没有成功,该怎么做?
谢谢。