简体   繁体   中英

unable to play local audio .wav file with wavesurfer.js

i unable to play my local audio file in wavesurfer.js. If i pass direct local file path to load method it raises the exception in browser console. Could any one solve me this with snippet will be appreciate. Thanks in advance Here is my code

       var wavesurfer = WaveSurfer.create({
           container: '#player',
           waveColor: 'violet',
           progressColor: 'purple',
           scrollParent: true,
           hideScrollbar: true
       });

       wavesurfer.load("C://user/bla bla...");

here it raises error

You cannot read directly from the hard drive with Javascript. You need to save the file on the web server, or if you are running the JS file, then locally save the file in the same folder as the js files and change:

wavesurfer.load("C://user/bla bla...");

to:

wavesurfer.load("file_name");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM