chore: More revert recorder
This commit is contained in:
parent
cf574d0b68
commit
bedd4e9ade
4 changed files with 11 additions and 10 deletions
|
|
@ -31,12 +31,13 @@ class RecordingDialogState extends State<RecordingDialog> {
|
|||
final _audioRecorder = Record();
|
||||
final List<double> amplitudeTimeline = [];
|
||||
|
||||
static const int bitRate = 16000;
|
||||
static const int bitRate = 64000;
|
||||
static const int samplingRate = 22050;
|
||||
|
||||
Future<void> startRecording() async {
|
||||
try {
|
||||
final tempDir = await getTemporaryDirectory();
|
||||
final path = _recordedPath =
|
||||
_recordedPath =
|
||||
'${tempDir.path}/recording${DateTime.now().microsecondsSinceEpoch}.${RecordingDialog.recordingFileType}';
|
||||
|
||||
final result = await _audioRecorder.hasPermission();
|
||||
|
|
@ -45,10 +46,10 @@ class RecordingDialogState extends State<RecordingDialog> {
|
|||
return;
|
||||
}
|
||||
await WakelockPlus.enable();
|
||||
|
||||
await _audioRecorder.start(
|
||||
path: _recordedPath,
|
||||
bitRate: bitRate,
|
||||
path: path,
|
||||
samplingRate: samplingRate,
|
||||
);
|
||||
setState(() => _duration = Duration.zero);
|
||||
_recorderSubscription?.cancel();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue