Ejemplo n.º 1
0
 public LoudMouthPage()
 {
     people   = db.GetAll <Attendee>();
     recorder = new RecordingController();
     db.removeAll <AudioFile>();
     Recordings = new ObservableCollection <AudioFile>();
     InitializeComponent();
     RecordingsList.ItemsSource = Recordings;
 }
Ejemplo n.º 2
0
        public async Task Returns_400_Result_When_Missing_Location()
        {
            var clientFactory = ClientBuilder.XenoCantoClientFactory(XenoCantoResponses.NotFoundResponse);
            var service       = new XenoCantoService(clientFactory);
            var sut           = new RecordingController(new NullLogger <RecordingController>(), service);

            var result = await sut.GetRecordingsAsync(String.Empty) as ObjectResult;

            Assert.Equal(400, result.StatusCode);
        }
Ejemplo n.º 3
0
        public async Task Returns_OkResult_With_Recording()
        {
            var clientFactory = ClientBuilder.XenoCantoClientFactory(XenoCantoResponses.OkResponse);
            var service       = new XenoCantoService(clientFactory);
            var sut           = new RecordingController(new NullLogger <RecordingController>(), service);

            var result = await sut.GetRecordingsAsync("Branta canadensis") as OkObjectResult;

            Assert.IsType <List <RecordingViewModel> >(result.Value);
            Assert.Equal(200, result.StatusCode);
        }
Ejemplo n.º 4
0
        public async Task Returns_BadRequestResult_When_Location_Not_Found()
        {
            var clientFactory = ClientBuilder.XenoCantoClientFactory(XenoCantoResponses.NotFoundResponse,
                                                                     HttpStatusCode.NotFound);
            var service = new XenoCantoService(clientFactory);
            var sut     = new RecordingController(new NullLogger <RecordingController>(), service);

            var result = await sut.GetRecordingsAsync("Westworld") as ObjectResult;

            Assert.Contains("not found", result.Value.ToString());
            Assert.Equal(400, result.StatusCode);
        }
Ejemplo n.º 5
0
        public async Task Returns_500_When_Api_Returns_Error()
        {
            var clientFactory = ClientBuilder.XenoCantoClientFactory(XenoCantoResponses.UnauthorizedResponse,
                                                                     HttpStatusCode.Unauthorized);
            var service = new XenoCantoService(clientFactory);
            var sut     = new RecordingController(new NullLogger <RecordingController>(), service);

            var result = await sut.GetRecordingsAsync("Rio de Janeiro") as ObjectResult;

            Assert.Contains("Error response from XenoCantoApi: Unauthorized", result.Value.ToString());
            Assert.Equal(500, result.StatusCode);
        }
Ejemplo n.º 6
0
        public static void FinishGame(bool disconnected = false)
        {
            // get the recording

            RecordingController recorder  = GameObject.FindObjectOfType <RecordingController> ();
            Recording           recording = null;

            if (recorder != null)
            {
                recording = recorder.GetRecording();
            }

            // take it to the postgame menu

            SceneManager.ExitGameOnFinish(recording, disconnected);
        }
Ejemplo n.º 7
0
        public void GivenACreateAction_ThenCreateIsCalledOnce()
        {
            var mockRepository = new Mock <IRecordingRepository>();

            mockRepository.Setup(r => r.Create(It.IsAny <Recording>()));

            var controller = new RecordingController(mockRepository.Object);

            controller.WithCallTo(c => c.Create("1", "caller", "transcription", "url"))
            .ShouldReturnTwiMLResult(r =>
            {
                Assert.That(r.ToString(), Contains.Substring("Recording saved"));
            });

            mockRepository.Verify(x => x.Create(It.IsAny <Recording>()), Times.Once);
        }
Ejemplo n.º 8
0
        void Enroll(object sender, EventArgs a)
        {
            enroling = !enroling;

            if (!enroling || string.IsNullOrEmpty(person.Name))
            {
                return;
            }

            ProgressIndicator.IsVisible = true;
            var startTime = DateTime.Now;

            recorder.StartRecording(person.Name);
            AudioFile file = new AudioFile {
                CreatedAt = new DateTimeOffset(DateTime.Now),
                FileName  = person.Name,
            };

            Task.Run(async() => {
                while (enroling)
                {
                    var timespan = (DateTime.Now - startTime).Seconds;
                    Device.BeginInvokeOnMainThread(() => {
                        EnrollButton.Text = timespan + " seconds";
                    });
                }

                recorder.StopRecording();
                while (recorder.audio.IsRecording)
                {
                }
                file.FinishedAt = DateTime.Now;
                file.Seconds    = (DateTime.Now - startTime).Seconds;
                if (await network.EnrolProfile(person, file))
                {
                    callback.Invoke(true);
                    await PopupNavigation.PopAsync();
                    recorder = null;
                }
                Device.BeginInvokeOnMainThread(() => {
                    ProgressIndicator.IsVisible = false;
                });
            });
        }
Ejemplo n.º 9
0
        public override void Init()
        {
#if LFE_DEBUG
            SuperController.LogMessage($"Init()");
#endif

            if (!containingAtom || containingAtom.type != "Person")
            {
                SuperController.LogError("This plugin must be placed on a person", false);
                enabled = false;
                return;
            }

            HeadController       = containingAtom.freeControllers.Single(fc => fc.name == "headControl");
            OriginalHeadRotation = HeadController.transform.rotation;

            DeviceController    = new DeviceController(this, null);
            SettingsController  = new SettingsController(this);
            RecordingController = new RecordingController(this);
            UIController        = new UIController(this);
        }
Ejemplo n.º 10
0
 void Start()
 {
     bodySourceManager = GameObject.FindObjectOfType <BodySourceManager>();
     lrc = this.GetComponent <LineRendererController>();
     recordingController = RecordingController.Instance;
     //store bones in a list for easier access
     _BoneMap = new Dictionary <JointType, GameObject>()
     {
         { JointType.SpineBase, SpineBase },
         { JointType.SpineMid, SpineMid },
         { JointType.Neck, Neck },
         { JointType.Head, Head },
         { JointType.ShoulderLeft, ShoulderLeft },
         { JointType.ElbowLeft, ElbowLeft },
         { JointType.WristLeft, WristLeft },
         { JointType.HandLeft, HandLeft },
         { JointType.ShoulderRight, ShoulderRight },
         { JointType.ElbowRight, ElbowRight },
         { JointType.WristRight, WristRight },
         { JointType.HandRight, HandRight },
         { JointType.HipLeft, HipLeft },
         { JointType.KneeLeft, KneeLeft },
         { JointType.AnkleLeft, AnkleLeft },
         { JointType.FootLeft, FootLeft },
         { JointType.HipRight, HipRight },
         { JointType.KneeRight, KneeRight },
         { JointType.AnkleRight, AnkleRight },
         { JointType.FootRight, FootRight },
         { JointType.SpineShoulder, SpineShoulder },
         { JointType.HandTipLeft, HandTipLeft },
         { JointType.ThumbLeft, ThumbLeft },
         { JointType.HandTipRight, HandTipRight },
         { JointType.ThumbRight, ThumbRight }
     };
     //_bonePos = new Vector4[(int)BoneIndex.Num_Bones];
 }
Ejemplo n.º 11
0
 public void SetUp()
 {
     gameObject          = new GameObject();
     recordingController = gameObject.AddComponent <RecordingController>();
 }
Ejemplo n.º 12
0
 public static void SetUpClass()
 {
     controller = GetClient().Recording;
 }
 public CoverageResult GetCoverageResult()
 {
     CheckInstrumented();
     return(RecordingController.CollectResultAndReset());
 }
 public void ResetHits()
 {
     CheckInstrumented();
     RecordingController.ResetHits();
 }
Ejemplo n.º 15
0
        /// <summary>
        /// Runs when DiScribe bot dials in to Webex meeting. Dials in to a Webex
        /// meeting and Performs transcription and speaker
        /// recognition. Then emails meeting transcript to all participants
        /// and updates the meeting record in DiScribe DB.
        /// </summary>
        /// <param name="appConfig"></param>
        /// <returns></returns>
        static int Run(MeetingInfo meetingInfo, IConfigurationRoot appConfig)
        {
            try
            {
                /*dialing & recording */
                var rid = new DialerController(appConfig).CallMeetingAsync(meetingInfo.AccessCode).Result;

                var recording = new RecordingController(appConfig).DownloadRecordingAsync(rid).Result;

                /*Make controller for accessing registered user profiles in Azure Speaker Recognition endpoint */
                var regController = RegistrationController.BuildController(appConfig["DB_CONN_STR"],
                                                                           EmailHelper.FromEmailAddressListToStringList(meetingInfo.AttendeesEmails), appConfig["SPEAKER_RECOGNITION_ID_KEY"]);

                /*initializing the transcribe controller */
                SpeechConfig speechConfig         = SpeechConfig.FromSubscription(appConfig["SPEECH_RECOGNITION_KEY"], appConfig["SPEECH_RECOGNITION_LOCALE"]);
                var          transcribeController = new TranscribeController(recording, regController.UserProfiles, speechConfig, appConfig["SPEAKER_RECOGNITION_ID_KEY"]);

                /*Performs transcription and speaker recognition. If success, then send email minutes to all participants */
                if (transcribeController.Perform())
                {
                    EmailSender.SendMinutes(meetingInfo, transcribeController.WriteTranscriptionFile(rid));
                    Console.WriteLine(">\tTask Complete!");
                }
                else
                {
                    EmailSender.SendEmail(meetingInfo, $"Failed to Generate Meeting Minutes for {meetingInfo.Subject}");
                    Console.WriteLine(">\tFailed to generate!");
                    return(-1);
                }

                /*Set meeting minutes contents and file location in the Meeting object */
                meetingInfo.Meeting.MeetingFileLocation = transcribeController.MeetingMinutesFile.FullName;
                meetingInfo.Meeting.MeetingMinutes      = transcribeController.Transcription;

                /*Sync meeting object with DiScribe DB */
                meetingInfo.Meeting.Update();



                return(0);
            }
            catch (AggregateException exs)
            {
                foreach (var ex in exs.InnerExceptions)
                {
                    Console.Error.WriteLine(ex.Message);
                }
                return(-1);
            }
            finally
            {
                try
                {
                    int max_size = 100;
                    Console.WriteLine("Recordings in total exceeds "
                                      + max_size + "Mb in size. Removing Oldest Recording\n["
                                      + DeleteOldestRecordingIfLargerThan(max_size) + "]");
                }
                catch (Exception ex)
                {
                    Console.Error.WriteLine("Could not remove oldest recording Reason: " + ex.Message);
                }
            }
        }
Ejemplo n.º 16
0
 void Awake()
 {
     recording = GetComponent <RecordingController>();
 }
Ejemplo n.º 17
0
 public void SetClip(RecordingController recordingController)
 {
     skeletonFrames = recordingController.GetRecordedFrames();
 }