p5.j​​s的“ preload”功能无法在调用“ setup”之前加载声音

时间:2019-07-11 19:38:53

标签: javascript html5-canvas p5.js

我目前正在编写一个p5.js程序,该程序应同时播放音乐和视觉效果。但是,在预加载功能中使用“ loadSound”加载多个音频文件并尝试播放该文件将产生此错误:

Sub calcMonthly()

Dim ws As Worksheet
Dim wssum As Worksheet

'set worksheets to copy values
Set ws = Sheets("Sheet 1")
Set wssum = Sheets("Sheet 2")


Dim i As Integer
Dim j As Integer
Dim k As Integer

Dim bumonth As Currency
Dim busum As Currency


'sort through Departments for % breakdown
For k = 0 To 18

    'sort through months
    For i = 0 To 11
    busum = 0
        'sort through each item
        For j = 0 To 350
            bumonth = 0
            bumonth = CCur(ws.Cells(3 + j, 37 + k).Value * ws.Cells(3 + j, 24 + i).Value)
            busum = busum + bumonth
        Next j
    'row C holds the string which details if the item if physical hardware or digital then uploads it to the cell
    If ws.Cells(3 + j, 3) = "SW" Then
        wssum.Cells(3 + k, 2 + i).Value = busum
    Else
        wssum.Cells(3 + k, 14 + i).Value = busum
    End If
    Next i
Next k


End Sub

尽管所有加载调用都在preload函数中。

我尝试删除了一些歌曲,以查看是否有任何特定文件引起了问题。 经过一番试验后,似乎是在完成一条或多条较短轨道的调用后才进行设置,而较长轨道则被卸载。 也许一旦一个文件被完全加载,它将继续进行设置,而不会加载其余文件。尽管我不知道为什么会这么做。在预加载中加载图片似乎不是这种情况。

Uncaught not ready to play file, buffer has yet to load. Try preload()

我希望Song2可以播放,但是加载失败。

0 个答案:

没有答案