Flutter语音录制自定义波形



我正在尝试使用Flutter构建一个语音助手应用程序,我想制作一个类似->波浪图像
当然,我用动画制作了这个小部件!:

Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
...List<Widget>.generate(12, (index) => VoiceLine())
],
),
), 

VoiceLine小部件:构建(BuildContext上下文){

return Container(
margin: EdgeInsets.all(8.0),
width: 8.0,
height: 8.0 + _animation.value,
decoration: BoxDecoration(
color: AppColors.secondaryColorWhite,
borderRadius: BorderRadius.circular(5),
),
);

但我希望这个波形[每条线的大小]对用户的声音敏感
我该怎么做

如果您觉得可以使用第三方软件包来实现这一点,您可以使用以下任意一种:

  • 音频波形-https://pub.dev/packages/audio_waveforms
  • 音频可视化工具-https://pub.dev/packages/audio_visualizer

你可以仔细检查一下他们是否能满足你的需求。

最新更新