예제 #1
0
        private AudioType GetAudioType(AudioCodecs audioCodecs)
        {
            AudioType type = AudioType.OGGVORBIS;

            switch (audioCodecs)
            {
            case AudioCodecs.AAC:
                type = AudioType.ACC;
                break;

            case AudioCodecs.MP3:
                type = AudioType.MPEG;
                break;

            case AudioCodecs.OGG:
                type = AudioType.OGGVORBIS;
                break;

            case AudioCodecs.WAV:
                type = AudioType.WAV;
                break;

            default:
                type = AudioType.OGGVORBIS;
                break;
            }

            return(type);
        }
예제 #2
0
        public string GetTextToSpeechAudio(string content, Language language = Language.English_UnitedStates, AudioCodecs audioCodecs = AudioCodecs.OGG)
        {
            selectedLanguage    = language;
            selectedAudioCodecs = audioCodecs;

            return(SetupAudioURL(content, _currentLanguage, _currentAudioCodecs));
        }
 /// <summary>
 /// Initialises ResponseCameraStream
 /// </summary>
 /// <param name="uri"></param>
 /// <param name="expirationTime"></param>
 /// <param name="protocol"></param>
 /// <param name="resolution"></param>
 /// <param name="authorizationType"></param>
 /// <param name="videoCodec"></param>
 /// <param name="audioCodec"></param>
 /// <param name="idle"></param>
 public ResponseCameraStream(string uri, CameraProtocols protocol, Resolution resolution, CameraAuthorizationTypes authorizationType,
                             VideoCodecs videoCodec, AudioCodecs audioCodec, int?idle = null, DateTime?expirationTime = null)
     : base(protocol, resolution, authorizationType, videoCodec, audioCodec)
 {
     URI                = uri;
     ExpirationTime     = expirationTime;
     IdleTimeoutSeconds = idle;
 }
예제 #4
0
 /// <summary>
 /// Initilializes Camerastream
 /// </summary>
 /// <param name="protocol"></param>
 /// <param name="resolution"></param>
 /// <param name="authorizationType"></param>
 /// <param name="videoCodec"></param>
 /// <param name="audioCodec"></param>
 public CameraStream(CameraProtocols protocol, Resolution resolution, CameraAuthorizationTypes authorizationType, VideoCodecs videoCodec, AudioCodecs audioCodec)
 {
     Protocol          = protocol;
     Resolution        = resolution;
     AuthorizationType = authorizationType;
     VideoCodec        = videoCodec;
     AudioCodec        = audioCodec;
 }
예제 #5
0
        // ===============================
        // Helper Method
        // ===============================

        private Task GetAudioCodecs()
        {
            var task = Task.Run(() =>
            {
                #if NETFX_CORE
                lock (_audioLock)
                {
                    foreach (var codec in WebRTC.GetAudioCodecs())
                    {
                        AudioCodecs.Add(codec);
                    }
                }
                #endif
            });

            return(task);
        }
 private void TestResponseCameraStream(ResponseCameraStream s, string uri, DateTime expirationTime, int idleTimeout,
                                       CameraProtocols protocol, int width, int height, CameraAuthorizationTypes authorizationType, VideoCodecs videoCodec, AudioCodecs audioCodec)
 {
     Assert.Equal(uri, s.URI);
     Assert.Equal(expirationTime.ToUniversalTime(), s.ExpirationTime);
     Assert.Equal(idleTimeout, s.IdleTimeoutSeconds);
     TestRequestCameraStream(s, protocol, width, height, authorizationType, videoCodec, audioCodec);
 }
 private void TestRequestCameraStream(CameraStream s, CameraProtocols protocol, int width, int height,
                                      CameraAuthorizationTypes authorizationType, VideoCodecs videoCodec, AudioCodecs audioCodec)
 {
     Assert.Equal(protocol, s.Protocol);
     Assert.NotNull(s.Resolution);
     Assert.Equal(width, s.Resolution.Width);
     Assert.Equal(height, s.Resolution.Height);
     Assert.Equal(authorizationType, s.AuthorizationType);
     Assert.Equal(videoCodec, s.VideoCodec);
     Assert.Equal(audioCodec, s.AudioCodec);
 }
예제 #8
0
        /// <summary>
        /// Builds the dlna URL.
        /// </summary>
        private static string BuildDlnaUrl(string deviceID, VideoCodecs? videoCodec, AudioCodecs? audioCodec, int? subtitleIndex, int? audiostreamIndex, int? videoBitrate, int? audiochannels, int? audioBitrate, long? startPositionTicks, string profile, string videoLevel)
        {
            var usCulture = new CultureInfo("en-US");

            var dlnaparam = string.Format("Params={0};", deviceID);

            dlnaparam += videoCodec.HasValue ? videoCodec.Value + ";" : ";";
            dlnaparam += audioCodec.HasValue ? audioCodec.Value + ";" : ";";
            dlnaparam += audiostreamIndex.HasValue ? audiostreamIndex.Value.ToString(usCulture) + ";" : ";";
            dlnaparam += subtitleIndex.HasValue ? subtitleIndex.Value.ToString(usCulture) + ";" : ";";
            dlnaparam += videoBitrate.HasValue ? videoBitrate.Value.ToString(usCulture) + ";" : ";";
            dlnaparam += audioBitrate.HasValue ? audioBitrate.Value.ToString(usCulture) + ";" : ";";
            dlnaparam += audiochannels.HasValue ? audiochannels.Value.ToString(usCulture) + ";" : ";";
            dlnaparam += startPositionTicks.HasValue ? startPositionTicks.Value.ToString(usCulture) + ";" : ";";
            dlnaparam += profile + ";";
            dlnaparam += videoLevel + ";";

            return dlnaparam;
        }