Andrew Watson
01/25/2024, 6:45 AMAVAudioPlayer
, and no matter what I do, just instantiating it gives me a null pointer exception. Based on some other threads here in this Slack, the latest thing I'm trying is:
lateinit var player: AVAudioPlayer
memScoped {
val errorPtr: ObjCObjectVar<NSError?> = alloc<ObjCObjectVar<NSError?>>()
player = AVAudioPlayer(mp3Url!!, errorPtr.ptr)
//println(errorPtr.ptr) //Will be null if the call succeeds.
}
My theory is that I'm not passing the right thing for the second argument of the constructor; it's the weird objc error pointer thingy. That said, the argument says it is nullable, so it wold seem passing null should work there. I tried that but have the same NPE.
Has anyone else gotten AVAudioPlayer
to work? Gotten the objs error pointers to work?Joel Denke
01/25/2024, 7:05 AMJoel Denke
01/25/2024, 7:09 AMAndrew Watson
01/25/2024, 5:15 PMAndrew Watson
01/25/2024, 5:15 PMMats-Hjalmar
02/01/2024, 7:24 AM