Exemplo n.º 1
0
		private void loadIos(String url)
		{
			_url = url;

			var mediaFile = NSUrl.FromFilename(_url);
			_player = AVAudioPlayer.FromUrl(mediaFile);

			if (null != _player)
			{
			    if (_players.Count == NumberOfPlayers) 
				{
				    _players.Dequeue().Dispose();
				}
				
				_players.Enqueue(_player);

				_player.PrepareToPlay();

				_channel = new SoundChannel();
				_channel.Player = _player;

				_player.DecoderError += delegate {
					this.dispatchEvent(new IOErrorEvent(IOErrorEvent.IO_ERROR));
				};

				_player.FinishedPlaying += delegate { 
					_channel.dispatchEvent (new Event (Event.SOUND_COMPLETE));
					//_player.Dispose(); 
				};

				this.dispatchEvent(new Event(Event.COMPLETE));

			}

		}