public VoiceRecorder()
 {
     mRecordingState = new VoiceRecordingState();
     mEncordingFormatState = new EncordingFormatState();
     mEncordingQualityState = new EncordingQualityState();
 }
        private MediaEncodingProfile getProfileFromEncordingFormat(EncordingFormatState encordingFormatState, 
                                                                   EncordingQualityState encordingQualityState)
        {
            if (encordingFormatState == null || encordingQualityState == null) {
                return null;
            }

            AudioEncodingQuality quality = getAudioEncordingQuality(encordingQualityState);

            MediaEncodingProfile encordingProfile = null;
            switch (mEncordingFormatState.EncordingFormat)
            {
                case EncordingFormatType.Mp3:
                    encordingProfile = MediaEncodingProfile.CreateMp3(quality);
                    break;
                case EncordingFormatType.Mp4:
                    encordingProfile = MediaEncodingProfile.CreateM4a(quality);
                    break;
                case EncordingFormatType.Wma:
                    encordingProfile = MediaEncodingProfile.CreateWma(quality);
                    break;
                case EncordingFormatType.Wav:
                    encordingProfile = MediaEncodingProfile.CreateWav(quality);
                    break;
            }

            return encordingProfile;
        }