File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export default class WebAudio {
1212 protected audioBuffer ! : AudioBuffer
1313 protected audioBufferSourceNode ! : AudioBufferSourceNode
1414 private filterData ! : number [ ] [ ]
15- private response ! : Response
15+ private arrayBuffer ! : ArrayBuffer
1616
1717 constructor ( props : IllestWaveformProps ) {
1818 this . props = props
@@ -36,15 +36,15 @@ export default class WebAudio {
3636
3737 public async fetchAudioFile ( ) : Promise < void > {
3838 try {
39- this . response = await fetch ( this . props . url )
39+ const response = await fetch ( this . props . url )
40+ this . arrayBuffer = await response . arrayBuffer ( )
4041 } catch ( error ) {
4142 console . error ( error )
4243 }
4344 }
4445
4546 private async createAudioBuffer ( ) : Promise < void > {
46- const arrayBuffer : ArrayBuffer = await this . response . arrayBuffer ( )
47- this . audioBuffer = await this . audioCtx . decodeAudioData ( arrayBuffer )
47+ this . audioBuffer = await this . audioCtx . decodeAudioData ( this . arrayBuffer )
4848 }
4949
5050 private createFilterData ( ) : void {
You can’t perform that action at this time.
0 commit comments