class AudioRecordModel(private val context: Application) : AndroidViewModel(context) {
private var recoder: MediaRecorder? = null
var isRecording by mutableStateOf(false)
val currentTime = System.currentTimeMillis().let {
SimpleDateFormat("yyyy-MM-dd_HH:mm:ss", Locale.TAIWAN).format(it)
File(context.getExternalFilesDir(Environment.DIRECTORY_MUSIC), "$currentTime.m4a")
recoder = MediaRecorder(context).apply {
setAudioSource(MediaRecorder.AudioSource.MIC)
setOutputFormat(MediaRecorder.OutputFormat.MPEG_4)
setAudioEncoder(MediaRecorder.AudioEncoder.AAC)