Android 转换列表<;int>;发出颤音
我用来获取麦克风的实时值 我用一个聆听者Android 转换列表<;int>;发出颤音,android,flutter,audio-player,audio-converter,Android,Flutter,Audio Player,Audio Converter,我用来获取麦克风的实时值 我用一个聆听者 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,
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
的音频,换句话说,我想播放列表中的音频,但我没有成功,我该怎么做
谢谢。当您读取二进制格式的文件时,您将得到Uint8列表,您拥有的是加载到内存中的音频文件,您可以通过将UINT写入磁盘(例如sample.wav)来获得音频文件(考虑到UINT是wav类型),这样您就可以保存文件并使用pub中提供的软件包播放它