I want to create an audio wave while recording in flutter. To record voice I am using Flutter Audio Recorder. To create wave I tried this plugin as well Wave Generator, but could not find any positive results.
Code Sample:
class AudioWave extends StatelessWidget {
const AudioWave({
Key key,
@required this.translateX,
@required List<double> audioPowerData,
}) : _audioPowerData = audioPowerData,
super(key: key);
final double translateX;
final List<double> _audioPowerData;
@override
Widget build(BuildContext context) {
return Container(
width: screenUtil.screenWidth,
margin: const EdgeInsets.only(top: 0, right: 0),
alignment: Alignment.topRight,
child: CustomPaint(
child: Container(height: 180.0, width: screenUtil.screenWidth),
painter: CurvePainter(translateX: translateX, data: _audioPowerData),
isComplex: true,
willChange: false,
),
);
}
}