@@ -62,7 +62,7 @@ class j {
6262 u ( this , "audioBuffer" ) ;
6363 u ( this , "audioBufferSourceNode" ) ;
6464 u ( this , "filterData" ) ;
65- u ( this , "response " ) ;
65+ u ( this , "arrayBuffer " ) ;
6666 this . props = e , this . audioCtx = new AudioContext ( ) ;
6767 }
6868 get _filterData ( ) {
@@ -78,14 +78,14 @@ class j {
7878 }
7979 async fetchAudioFile ( ) {
8080 try {
81- this . response = await fetch ( this . props . url ) ;
81+ const e = await fetch ( this . props . url ) ;
82+ this . arrayBuffer = await e . arrayBuffer ( ) ;
8283 } catch ( e ) {
8384 console . error ( e ) ;
8485 }
8586 }
8687 async createAudioBuffer ( ) {
87- const e = await this . response . arrayBuffer ( ) ;
88- this . audioBuffer = await this . audioCtx . decodeAudioData ( e ) ;
88+ this . audioBuffer = await this . audioCtx . decodeAudioData ( this . arrayBuffer ) ;
8989 }
9090 createFilterData ( ) {
9191 const e = this . props . samplingRate , t = this . audioBuffer . numberOfChannels , a = [ ] , n = [ ] ;
@@ -214,35 +214,35 @@ const Z = /* @__PURE__ */ L({
214214 n . value = ! 0 ;
215215 }
216216 const l = d ( null ) , r = d ( ! 1 ) ;
217- let s , f ;
217+ let s , h ;
218218 async function x ( ) {
219219 r . value || ( t ( "onInit" , ! 0 ) , await S ( ) , await W ( ) , r . value = ! 0 , t ( "onReady" , r . value ) ) ;
220220 }
221221 async function S ( ) {
222222 s = new G ( a ) , await s . fetchAudioFile ( ) , t ( "onFetched" , ! 0 ) , await s . setupAudio ( ) , R ( ) ;
223223 }
224224 async function W ( ) {
225- f = new U (
225+ h = new U (
226226 l . value ,
227227 a ,
228228 s . _filterData
229- ) , f . setupCanvas ( ) , m ( ( ) => {
230- f . _props = a , f . setWaveStyle ( w . value ) ;
229+ ) , h . setupCanvas ( ) , m ( ( ) => {
230+ h . _props = a , h . setWaveStyle ( w . value ) ;
231231 } ) ;
232232 }
233233 const v = d ( 0 ) , p = d ( 0 ) , w = d ( 0 ) ;
234234 function g ( ) {
235- ! s . _playing || ( requestAnimationFrame ( g ) , p . value = s . _currentTime , w . value = p . value / s . _audioDuration * f . _canvas . width ) ;
235+ ! s . _playing || ( requestAnimationFrame ( g ) , p . value = s . _currentTime , w . value = p . value / s . _audioDuration * h . _canvas . width ) ;
236236 }
237- function T ( h ) {
238- ! r . value || ! a . interact || ( h . layerX <= 0 ? v . value = 0 : h . layerX >= f . _canvas . width ? v . value = f . _canvas . width : v . value = h . layerX ) ;
237+ function T ( f ) {
238+ ! r . value || ! a . interact || ( f . layerX <= 0 ? v . value = 0 : f . layerX >= h . _canvas . width ? v . value = h . _canvas . width : v . value = f . layerX ) ;
239239 }
240240 function N ( ) {
241241 if ( ! r . value || ! a . interact )
242242 return ;
243243 w . value = v . value ;
244- const h = v . value / f . _canvas . width * s . _audioDuration ;
245- s . pick ( h ) , p . value = h , t ( "onClick" , o ) , t ( "onFinish" , ! 1 ) ;
244+ const f = v . value / h . _canvas . width * s . _audioDuration ;
245+ s . pick ( f ) , p . value = f , t ( "onClick" , o ) , t ( "onFinish" , ! 1 ) ;
246246 }
247247 function b ( ) {
248248 ! r . value || ( s . play ( ) , t ( "onPlay" , ! 0 ) , g ( ) ) ;
@@ -265,16 +265,16 @@ const Z = /* @__PURE__ */ L({
265265 return D ( p . value ) ;
266266 }
267267 function H ( ) {
268- const h = s . _audioDuration ;
269- return D ( h ) ;
268+ const f = s . _audioDuration ;
269+ return D ( f ) ;
270270 }
271271 return e ( {
272272 play : b ,
273273 pause : B ,
274274 replay : F ,
275275 getCurrentTime : z ,
276276 getDuration : H
277- } ) , ( h , at ) => ( P ( ) , X ( "section" , {
277+ } ) , ( f , at ) => ( P ( ) , X ( "section" , {
278278 id : "illest-wave-container" ,
279279 ref_key : "waveformContainer" ,
280280 ref : o ,
0 commit comments