Skip to content

Commit eaab2ce

Browse files
SoundRecorder: update max duration after stopping recording
1 parent 29af03e commit eaab2ce

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

internal_filesystem/apps/com.micropythonos.soundrecorder/assets/sound_recorder.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,8 @@ def _on_play_clicked(self, event):
373373
success = AudioFlinger.play_wav(
374374
self._last_recording,
375375
stream_type=AudioFlinger.STREAM_MUSIC,
376-
on_complete=self._on_playback_complete
376+
on_complete=self._on_playback_complete,
377+
volume=100
377378
)
378379

379380
if success:
@@ -394,6 +395,11 @@ def _on_delete_clicked(self, event):
394395
os.remove(self._last_recording)
395396
print(f"SoundRecorder: Deleted {self._last_recording}")
396397
self._find_last_recording()
398+
399+
# Recalculate max duration (more space available now)
400+
self._current_max_duration_ms = self._calculate_max_duration()
401+
self._timer_label.set_text(self._format_timer_text(0))
402+
397403
self._status_label.set_text("Recording deleted")
398404
except Exception as e:
399405
print(f"SoundRecorder: Delete failed: {e}")

0 commit comments

Comments
 (0)