Click here to Skip to main content
15,897,187 members
Articles / Web Development / ASP.NET

Silverlight Pronunciation Test

Rate me:
Please Sign up or sign in to vote.
5.00/5 (12 votes)
29 Apr 2012CPOL11 min read 44K   1.7K   15  
How to create a pronunciation test tool using Silverlight and Python
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using PitchContour.ViewModels;

namespace PitchContour
{
    public partial class MainPage : UserControl
    {
        #region fields
        MainViewModel viewModel;
        #endregion

        #region ctor
        public MainPage()
        {
            InitializeComponent();
            viewModel = (MainViewModel)this.DataContext;
            viewModel.SampleVoiceMediaElement = this.sampleVoiceMediaElement;
            viewModel.UserVoiceMediaElement = this.userVoiceMediaElement;
        }
        #endregion ctor

        #region events
        private void sampleVoiceMediaElement_MediaOpened(object sender, RoutedEventArgs e)
        {
            viewModel.SampleVoiceDuration = this.sampleVoiceMediaElement.NaturalDuration;            
        }

        private void userVoiceMediaElement_MediaOpened(object sender, RoutedEventArgs e)
        {
            viewModel.UserVoiceDuration = this.userVoiceMediaElement.NaturalDuration;
        }
        #endregion events
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Instructor / Trainer Alura Cursos Online
Brazil Brazil

Comments and Discussions