I'm trying to load a sample into AKWavetable and get this error:
Thread 1: EXC_BAD_ACCESS (code=1, address=0x20)
It cant be the sample itself, because I have tried the whole thing with AKPlayer and it worked fine.. any ideas?
var sampler = AKWaveTable()
do
{
//sampler load sample
var audiofile = try AKAudioFile(readFileName: "SAUCE4.wav")
sampler = AKWaveTable(file: audiofile,
startPoint: 0,
endPoint: Sample(audiofile.length),
rate: 1,
volume: 1,
maximumSamples: Int(audiofile.samplesCount),
completionHandler: {print("completed")},
loadCompletionHandler: {print("loadcompleted")}
)
}
catch
{
print("No Such File...")
}
Output:
loadcompleted
(lldb)
Thread 1: EXC_BAD_ACCESS (code=1, address=0x20)