simple-web-audio-recorder-demo icon indicating copy to clipboard operation
simple-web-audio-recorder-demo copied to clipboard

Move index.html to another directory will not work

Open kflee2000 opened this issue 6 years ago • 6 comments

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.

kflee2000 avatar Jan 20 '19 04:01 kflee2000

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>

octavn avatar Jan 20 '19 20:01 octavn

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.

kflee2000 avatar Jan 21 '19 11:01 kflee2000

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:"/",

skgone avatar Aug 15 '19 11:08 skgone

I solved this problem. Just need to change the path in the app.js file, "/js"⇒"/static/js"

skgone avatar Aug 15 '19 15:08 skgone

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.

Sandip2k avatar May 22 '20 06:05 Sandip2k

This can be closed. :)

damienwolf07 avatar Mar 28 '21 12:03 damienwolf07