@@ -62,7 +62,7 @@ class j {
62
62
u ( this , "audioBuffer" ) ;
63
63
u ( this , "audioBufferSourceNode" ) ;
64
64
u ( this , "filterData" ) ;
65
- u ( this , "response " ) ;
65
+ u ( this , "arrayBuffer " ) ;
66
66
this . props = e , this . audioCtx = new AudioContext ( ) ;
67
67
}
68
68
get _filterData ( ) {
@@ -78,14 +78,14 @@ class j {
78
78
}
79
79
async fetchAudioFile ( ) {
80
80
try {
81
- this . response = await fetch ( this . props . url ) ;
81
+ const e = await fetch ( this . props . url ) ;
82
+ this . arrayBuffer = await e . arrayBuffer ( ) ;
82
83
} catch ( e ) {
83
84
console . error ( e ) ;
84
85
}
85
86
}
86
87
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 ) ;
89
89
}
90
90
createFilterData ( ) {
91
91
const e = this . props . samplingRate , t = this . audioBuffer . numberOfChannels , a = [ ] , n = [ ] ;
@@ -214,35 +214,35 @@ const Z = /* @__PURE__ */ L({
214
214
n . value = ! 0 ;
215
215
}
216
216
const l = d ( null ) , r = d ( ! 1 ) ;
217
- let s , f ;
217
+ let s , h ;
218
218
async function x ( ) {
219
219
r . value || ( t ( "onInit" , ! 0 ) , await S ( ) , await W ( ) , r . value = ! 0 , t ( "onReady" , r . value ) ) ;
220
220
}
221
221
async function S ( ) {
222
222
s = new G ( a ) , await s . fetchAudioFile ( ) , t ( "onFetched" , ! 0 ) , await s . setupAudio ( ) , R ( ) ;
223
223
}
224
224
async function W ( ) {
225
- f = new U (
225
+ h = new U (
226
226
l . value ,
227
227
a ,
228
228
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 ) ;
231
231
} ) ;
232
232
}
233
233
const v = d ( 0 ) , p = d ( 0 ) , w = d ( 0 ) ;
234
234
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 ) ;
236
236
}
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 ) ;
239
239
}
240
240
function N ( ) {
241
241
if ( ! r . value || ! a . interact )
242
242
return ;
243
243
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 ) ;
246
246
}
247
247
function b ( ) {
248
248
! r . value || ( s . play ( ) , t ( "onPlay" , ! 0 ) , g ( ) ) ;
@@ -265,16 +265,16 @@ const Z = /* @__PURE__ */ L({
265
265
return D ( p . value ) ;
266
266
}
267
267
function H ( ) {
268
- const h = s . _audioDuration ;
269
- return D ( h ) ;
268
+ const f = s . _audioDuration ;
269
+ return D ( f ) ;
270
270
}
271
271
return e ( {
272
272
play : b ,
273
273
pause : B ,
274
274
replay : F ,
275
275
getCurrentTime : z ,
276
276
getDuration : H
277
- } ) , ( h , at ) => ( P ( ) , X ( "section" , {
277
+ } ) , ( f , at ) => ( P ( ) , X ( "section" , {
278
278
id : "illest-wave-container" ,
279
279
ref_key : "waveformContainer" ,
280
280
ref : o ,
0 commit comments