simple-web-audio-recorder-demo
simple-web-audio-recorder-demo copied to clipboard
Move index.html to another directory will not work
Download and test all just fine but when index.html is copied to another directory, with intention to modify, it will not show play back audio control?
How to overcome this problem?
My application is to use it to record lots of very short Taiwanese dialect on a database as a blob and hopefully can be played back for learner.
If you move index.html you'll have to change the 2 paths to the .js
files at the bottom of index.html
to reflect the new relative location:
<script src="js/WebAudioRecorder.min.js"></script>
<script src="js/app.js"></script>
yes, I did and the recording / stop seems work ok; but after stop, it does not show the recording list like the other. Test move to a number of different places all show the same result, it seem the only place it work is in the default directory. I insert analert('createDownloadLink'); as first line in createDownloadLink, and it never come here if the index.html has moved. I test it on Firefox as I dont have access to https for test it in Chrome.
i have the same problem too。 I use the web framework of flask, put index.html under the templates folder, and put the relevant js file under the static folder. I modified the index.html reference to js,
After starting the flask program app.py, the following error occurred and the recording could not be performed. Log
getUserMedia() success, stream created, initializing WebAudioRecorder... Loading mp3 encoder... Recording started Recording stopped getUserMedia() success, stream created, initializing WebAudioRecorder... Loading mp3 encoder... Recording started Recording stopped getUserMedia() success, stream created, initializing WebAudioRecorder... Loading mp3 encoder... Recording started Recordings Do I need to modify the WebAudioRecorder.min.js file for this problem ? Var o={wav:"WebAudioRecorderWav.min.js",ogg:"WebAudioRecorderOgg.min.js",mp3:"WebAudioRecorderMp3.min.js"};var t={workerDir:"/",
I solved this problem. Just need to change the path in the app.js file, "/js"⇒"/static/js"
I solved this problem. Just need to change the path in the app.js file, "/js"⇒"/static/js"
Yeah he is right! I also changed the workerDir in app.js from "js/" to "static/main/js/" Change the workerDir according to your needs.
This can be closed. :)