Skip to content

Commit

Permalink
✨Feat: 녹음 - 2
Browse files Browse the repository at this point in the history
  • Loading branch information
seochan99 committed Feb 21, 2024
1 parent 2d4d89e commit 8412d17
Show file tree
Hide file tree
Showing 2 changed files with 164 additions and 167 deletions.
4 changes: 3 additions & 1 deletion lib/viewModels/record/record_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class RecordViewModel extends GetxController {
}

Future<void> _startRecording() async {
if (!_isRecorderInitialized || isRecording.value) return;
if (!_audioRecorder.isStopped) {
await _audioRecorder.closeRecorder();
}
Expand All @@ -38,15 +37,18 @@ class RecordViewModel extends GetxController {
await _audioRecorder.openRecorder();
_isRecorderInitialized = true;
final directory = await getApplicationDocumentsDirectory();

final filePath =
'${directory.path}/${DateTime.now().millisecondsSinceEpoch}.aac';
print(filePath);
try {
await _audioRecorder.startRecorder(
toFile: filePath,
codec: Codec.aacADTS,
);

isRecording.value = true;
print('Recording started');
} catch (_) {}
}

Expand Down
Loading

0 comments on commit 8412d17

Please sign in to comment.