瀏覽代碼

Fix ambiguity between f for the audio and f for csv

asobolev 1 年之前
父節點
當前提交
3ce37833a4
共有 2 個文件被更改,包括 5 次插入7 次删除
  1. 3 5
      controllers/microphones.ipynb
  2. 2 2
      controllers/microphones.py

+ 3 - 5
controllers/microphones.ipynb

@@ -98,8 +98,8 @@
     "                            print(\"Audio input stream started.\")\n",
     "                            t0 = time.time()\n",
     "                            stream.start()\n",
-    "                            with open(cfg['csv_path'], 'a') as f:\n",
-    "                                f.write(\",\".join([str(x) for x in (t0,)]) + \"\\n\")\n",
+    "                            with open(cfg['csv_path'], 'a') as f_csv:\n",
+    "                                f_csv.write(\",\".join([str(x) for x in (t0,)]) + \"\\n\")\n",
     "\n",
     "                        f.write(MicrophoneController.queue.get())\n",
     "\n",
@@ -225,7 +225,6 @@
    ]
   },
   {
-   "attachments": {},
    "cell_type": "markdown",
    "metadata": {},
    "source": [
@@ -345,7 +344,6 @@
    ]
   },
   {
-   "attachments": {},
    "cell_type": "markdown",
    "metadata": {},
    "source": [
@@ -614,7 +612,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.10.8"
+   "version": "3.8.8"
   },
   "vscode": {
    "interpreter": {

+ 2 - 2
controllers/microphones.py

@@ -53,8 +53,8 @@ class MicrophoneController(FPSTimes):
                             print("Audio input stream started.")
                             t0 = time.time()
                             stream.start()
-                            with open(cfg['csv_path'], 'a') as f:
-                                f.write(",".join([str(x) for x in (t0,)]) + "\n")
+                            with open(cfg['csv_path'], 'a') as f_csv:
+                                f_csv.write(",".join([str(x) for x in (t0,)]) + "\n")
 
                         f.write(MicrophoneController.queue.get())