diff pcm/pcm_tx.c @ 12:27ca01bb5b11

pcm: implement play-stop command
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 23 Jun 2024 20:06:09 +0000
parents e149ca1dd14f
children fa341317c844
line wrap: on
line diff
--- a/pcm/pcm_tx.c	Sun Jun 23 19:59:17 2024 +0000
+++ b/pcm/pcm_tx.c	Sun Jun 23 20:06:09 2024 +0000
@@ -194,3 +194,13 @@
 	play_buf_nframes = st.st_size / 160 + 1;
 	play_buf_ptr = 0;
 }
+
+void cmd_play_stop(int argc, char **argv)
+{
+	if (!record_file) {
+		printf("error: no file play in progress\n");
+		return;
+	}
+	free(play_buffer);
+	play_buffer = NULL;
+}