mimic-recording-studio icon indicating copy to clipboard operation
mimic-recording-studio copied to clipboard

Unhandled Rejection (TypeError): res.data is undefined

Open stchjaco opened this issue 1 year ago • 4 comments

Describe the bug Unhandled Rejection (TypeError): res.data is undefined // audio could no be written

./src/App/Record.js/Record/_this.processBlob/< C:/Users/Christian Jacob/mimic-recording-studio/frontend/src/App/Record.js:207 This screen is visible only in development. It will not appear if the app crashes in production. Open your browser’s developer console to further inspect this error.

To Reproduce Steps to reproduce the behavior: After starting mimic recording studio in the ...:3000 browser window, everything seems to work normal for a few seconds. The computer seems to hear the spoken words, an audio wave is showing up.

  1. However, when I am finished with the sentence and pause (i just keep my mouth shut and do nothing else) after half a second an error appears in the browser window. --> I managed to solve that particular issue by setting an environment variable to the ffmpeg path somehow. Then error 2) appeared.

  2. However, now the error in the frontend is something like "trouble writing audio" or "audio file could not be saved". There is no chance I get the recorded audio on my harddisk. MRS only writes the text file.

Also the following message is thrown in the python backend console :

[Errno 2] No such file or directory: 'C:\Users\Christian Jacob\mimic-recording-studio\backend\app\../audio_files/8ab2a2b4-9386-e828-6030-7a2711c2766c\97ac571fbf7c08333144aeda86f431b7.wav' 127.0.0.1 - - [24/Jul/2022 19:36:02] "POST /api/audio/?uuid=8ab2a2b4-9386-e828-6030-7a2711c2766c&prompt=The%20two%20mountains%20were%20used%20to%20symbolize%20the%20significance%20of%20the%20commandments%20and%20serve%20as%20a%20warning%20to%20whoever%20disobeyed%20them. HTTP/1.1" 200 -

  1. Now I am back on error 1 again. This is the full message:

Unhandled Rejection (TypeError): res.data is undefined ./src/App/Record.js/Record/_this.processBlob/< C:/Users/Christian Jacob/mimic-recording-studio/frontend/src/App/Record.js:207 This screen is visible only in development. It will not appear if the app crashes in production. Open your browser’s developer console to further inspect this error.

and this is the output of python backend console:

ffmpeg version 5.1-essentials_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers built with gcc 12.1.0 (Rev2, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband libavutil 57. 28.100 / 57. 28.100 libavcodec 59. 37.100 / 59. 37.100 libavformat 59. 27.100 / 59. 27.100 libavdevice 59. 7.100 / 59. 7.100 libavfilter 8. 44.100 / 8. 44.100 libswscale 6. 7.100 / 6. 7.100 libswresample 4. 7.100 / 4. 7.100 libpostproc 56. 6.100 / 56. 6.100 C:\Users\Christian: No such file or directory [Errno 2] No such file or directory: 'C:\Users\Christian Jacob\mimic-recording-studio\backend\app\../tmp/16288335642476400217.wav' 127.0.0.1 - - [24/Jul/2022 20:02:36] "POST /api/audio/?uuid=ea116a37-56f0-3586-a38d-b5811ab2c8bc&get_len=True HTTP/1.1" 200 -

The error refers to that part of the code:

processBlob = blob => { getAudioLen(this.uuid, blob) .then(res => res.json()) .then(res => this.setState({ audioLen: res.data.audio_len }) ); this.setState({ blob: blob }); this.shoulddisplayWav(true); };

Expected behavior Recording Studio should record the voice and not write a textfile only. Obviously the vocie file couldnt be written.

Log files there aren´t.

Environment (please complete the following information): Betriebsystemname Microsoft Windows 10 Pro Version 10.0.19043 Build 19043 Zusätzliche Betriebsystembeschreibung Nicht verfügbar Betriebsystemhersteller Microsoft Corporation Systemname DESKTOP-M6NER6I Systemhersteller FUJITSU Systemmodell ESPRIMO P920 Systemtyp x64-basierter PC System-SKU S26361-Kxxx-Vyyy Prozessor Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz, 3601 MHz, 4 Kern(e), 8 logische(r) Prozessor(en) BIOS-Version/-Datum FUJITSU // American Megatrends Inc. V4.6.5.4 R1.47.0 for D3222-A1x, 26.08.2019 SMBIOS-Version 2.7 Version des eingebetteten Controllers 255.255 BIOS-Modus UEFI BaseBoard-Hersteller FUJITSU BaseBoard-Produkt D3222-A1 BaseBoard-Version S26361-D3222-A1 Plattformrolle Desktop Sicherer Startzustand Aus PCR7-Konfiguration Erweiterung zum Anzeigen erforderlich Windows-Verzeichnis C:\Windows Systemverzeichnis C:\Windows\system32 Startgerät \Device\HarddiskVolume2 Gebietsschema Deutschland Hardwareabstraktionsebene Version = "10.0.19041.1806" Benutzername DESKTOP-M6NER6I\Christian Jacob Zeitzone Mitteleuropäische Sommerzeit Installierter physischer Speicher (RAM) 16,0 GB Gesamter physischer Speicher 15,9 GB Verfügbarer physischer Speicher 4,83 GB Gesamter virtueller Speicher 27,4 GB Verfügbarer virtueller Speicher 13,2 GB Größe der Auslagerungsdatei 11,5 GB Auslagerungsdatei C:\pagefile.sys

Please think carefully about whether you have modified anything in Mycroft's code or configuration files. No, not at all.


TL DR: Instead of the audio, only the text as textfile is stored into the "audio_files"-subdirectory. Anyone experienced that?

KR Chris

stchjaco avatar Jul 24 '22 15:07 stchjaco

Hey there,

Thanks for filling this. Unfortunately I don't have any Windows machines to test with but hopefully someone chimes in.

Depending on how time critical this is, as a work around you could use the Docker image.

krisgesling avatar Jul 25 '22 03:07 krisgesling

Same issue for me.

RobinE89 avatar Oct 11 '22 09:10 RobinE89

Hey Robin, this is how things work quite good: On a windows machine, download Ubuntu from the Microsoft app store. Then open an ubuntu terminal and install docker, ffmpeg and some more. The installation phase for Linux / Ubuntu is well described on Github. Finally install mycroft and run it in the ubuntu terminal, NOT in an virtual machine. This is how things go quite well. Only quite, because there are still some issues (maybe on my side, not the software): After some recordings (two dozens or more), I encountered a significant quality loss or even "holes" in the recording. Refreshing the browser was what helped me out. Always listen to your recorded stuff immediately, because once this "bug" was in, it hit all recordings thereafter. Refreshing made it go away easily for a while or two.

Another thing is that windows cant access the files Ubuntu, thus mycroft, writes. There are some software tools out there, but the easiest thing is to copy the data from the mycroft folder to the Users/Shared Folder which is accessible for both Windows and Ubuntu. So if you need to work on the recordings with windows software, say cutting off silence at the beginning or end, or looking for and deleting crap recordings (see above), you can do all this in the Shared folder with comfortable windows tools, and once you are done, move or copy the files back to the original Ubuntu / mycroft folder. If your audio base is getting really large, this will take a while, a matter of minutes.

KR Chris

stchjaco avatar Oct 12 '22 15:10 stchjaco

what you mean is called WindowsSubsystemLinux(WSL). if you solve the other bug I linked, then you can also run the recordingstudio directly in windows as a docker. But it still makes sense to deal with WSL because all training environments which I know cause problems under Windows and WSL can also be the solution here. because you have relatively unproblematic access to the graphics card and cuda can be used accordingly. I just don't know if it makes sense to install docker inside of an ubuntuWSL (because docker itself is a running WSL). Thanks for the tip about the audio quality loss -> it would be really bad if that happened. I'll take a look.

RobinE89 avatar Oct 17 '22 10:10 RobinE89