FWIW, I'm using AVAudioPlayer.FromUrl() and it works for me. I'm not disposing on FinishedPlaying, though, I've got separate code that calls Stop and then Dispose. I'm also not using AudioSession at all.
Note though that I'm still on MT 3.2.x, if that makes a difference. On Mon, Jul 18, 2011 at 3:18 PM, Tom Fanning <[email protected]> wrote: > Weird one this. > > In a ViewController I call the following code in ViewDidLoad(): > > AudioSession.Initialize(); > AudioSession.Category = AudioSessionCategory.MediaPlayback; > AudioSession.SetActive(true); > > Then in response to some button presses I do: > > NSError err; > var ap = AVAudioPlayer.FromUrl(new NSUrl("mysound.caf"), out err); > ap.FinishedPlaying += delegate { ap.Dispose(); }; > ap.Play(); > > And this works great, pretty responsive etc. > > Except sometimes, seemingly randomly, I get the following unhandled > exception in release mode on the device (iPhone 3GS): > > System.MissingMethodException: No constructor found for > MonoTouch.AVFoundation.InternalAVAudioPlayerDelegate::.ctor(System.IntPtr) > > Any ideas? Google comes up blank for that specific missing constructor. > > Thanks > Tom > > -- > Tom Fanning > _______________________________________________ > MonoTouch mailing list > [email protected] > http://lists.ximian.com/mailman/listinfo/monotouch > -- David Moles [email protected]
_______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
