Browse Source

Fix ambiguity between f for the audio and f for csv

asobolev 1 year ago
parent
commit
3ce37833a4
2 changed files with 5 additions and 7 deletions
  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",
     "                            print(\"Audio input stream started.\")\n",
     "                            t0 = time.time()\n",
     "                            t0 = time.time()\n",
     "                            stream.start()\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",
     "\n",
     "                        f.write(MicrophoneController.queue.get())\n",
     "                        f.write(MicrophoneController.queue.get())\n",
     "\n",
     "\n",
@@ -225,7 +225,6 @@
    ]
    ]
   },
   },
   {
   {
-   "attachments": {},
    "cell_type": "markdown",
    "cell_type": "markdown",
    "metadata": {},
    "metadata": {},
    "source": [
    "source": [
@@ -345,7 +344,6 @@
    ]
    ]
   },
   },
   {
   {
-   "attachments": {},
    "cell_type": "markdown",
    "cell_type": "markdown",
    "metadata": {},
    "metadata": {},
    "source": [
    "source": [
@@ -614,7 +612,7 @@
    "name": "python",
    "name": "python",
    "nbconvert_exporter": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
    "pygments_lexer": "ipython3",
-   "version": "3.10.8"
+   "version": "3.8.8"
   },
   },
   "vscode": {
   "vscode": {
    "interpreter": {
    "interpreter": {

+ 2 - 2
controllers/microphones.py

@@ -53,8 +53,8 @@ class MicrophoneController(FPSTimes):
                             print("Audio input stream started.")
                             print("Audio input stream started.")
                             t0 = time.time()
                             t0 = time.time()
                             stream.start()
                             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())
                         f.write(MicrophoneController.queue.get())