AudioDevices Property

Summary
Retrieves the audio capture device collection.
Syntax
C#
VB
C++
publicDevicesAudioDevices {get; }
PublicReadOnlyPropertyAudioDevicesAsDevices
public:propertyDevices^AudioDevices {Devices^get();}

Property Value

TheAudioDevicescollection.

Example
C#
VB
usingLeadtools;usingLeadtools.MediaStreaming;publicServer _server =null;publicbool_result =false;publicvoidPrintLiveStreamsExample(){try{stringstrLiveStreams ="";// create an instance of the server object_server =newLeadtools.MediaStreaming.Server();// retrieve a copy of the Live StreamsLiveStreams Streams = _server.GetLiveStreams();strLiveStreams +=string.Format("--- Live Streams (count = {0}) ---\n\n", Streams.Count.ToString());// print the all live streams properties to a stringfor(intnIndex = 0; nIndex < Streams.Count; nIndex++){LiveStream stream = Streams.GetLiveStream(nIndex);strLiveStreams +=string.Format("Live Stream[{0}]: Path = \"{1}\".\n", nIndex.ToString(), stream.Path);intnSelection = stream.VideoDevices.Selection;stringstrDevice ="";if(nSelection < 0)strDevice ="";elsestrDevice = stream.VideoDevices[nSelection].FriendlyName;strLiveStreams +=string.Format("Video Device = \"{0}\".\n", strDevice);nSelection = stream.AudioDevices.Selection;strDevice ="";if(nSelection < 0)strDevice ="";elsestrDevice = stream.AudioDevices[nSelection].FriendlyName;strLiveStreams +=string.Format(“音频德维克e = \"{0}\".\n", strDevice);strLiveStreams +=string.Format("Video Width = \"{0}\".\n", stream.VideoWidth.ToString());strLiveStreams +=string.Format("Video Height = \"{0}\".\n", stream.VideoHeight.ToString());if(stream.UseVideoInputSize)strLiveStreams +=string.Format("Use Video Input Size = \"true\".\n");elsestrLiveStreams +=string.Format("Use Video Input Size = \"false\".\n");strLiveStreams +=string.Format("Video Frame Rate = \"{0}\".\n", stream.VideoFrameRate.ToString());if(stream.UseVideoInputFrameRate)strLiveStreams +=string.Format("Use Video Input Frame Rate = \"true\".\n");elsestrLiveStreams +=string.Format("Use Video Input Frame Rate = \"false\".\n");strLiveStreams +=string.Format("Video Bit Rate = \"{0}\".\n", stream.VideoBitRate.ToString());if(stream.QSVAcceleration)strLiveStreams +=string.Format("QSVAcceleration = \"true\".\n");elsestrLiveStreams +=string.Format("QSVAcceleration = \"false\".\n");if(stream.CUDAAcceleration)strLiveStreams +=string.Format("CUDAAcceleration = \"true\".\n");elsestrLiveStreams +=string.Format("CUDAAcceleration = \"false\".\n");nSelection = stream.AudioTypes.Selection;stringstrType ="";if(nSelection < 0)strType ="";elsestrType = stream.AudioTypes[nSelection].FriendlyName;if(stream.UseDeviceEncoding)strLiveStreams +=string.Format("Use Device Encoding = \"true\".\n");elsestrLiveStreams +=string.Format("Use Device Encoding = \"false\".\n");strLiveStreams +=string.Format("Minimum Fragment Duration = \"{0}\".\n", stream.MinimumFragmentDuration.ToString());if(stream.Enable)strLiveStreams +=string.Format("Enable = \"true\".\n");elsestrLiveStreams +=string.Format(“启用= \”假\”。\ n”);if(stream.ActivateOnDemand)strLiveStreams +=string.Format("ActivateOnDemand = \"true\".\n");elsestrLiveStreams +=string.Format("ActivateOnDemand = \"false\".\n");strLiveStreams +=string.Format("IdleTimeOut = \"{0}\".\n", stream.IdleTimeOut.ToString());if(stream.CUDADecoding)strLiveStreams +=string.Format("CUDADecoding = \"true\".\n");elsestrLiveStreams +=string.Format("CUDADecoding = \"false\".\n");if(stream.QSVDecoding)strLiveStreams +=string.Format("QSVDecoding = \"true\".\n");elsestrLiveStreams +=string.Format("QSVDecoding = \"false\".\n");if(stream.HasVideoDeviceURL){strLiveStreams +=string.Format("VideoDeviceURL = \"{0}\".\n", stream.VideoDeviceURL);}}// display a message contains the Live Streams information stringMessageBox.Show(strLiveStreams,"LEADTOOLS Media Streaming Examples", MessageBoxButtons.OK, MessageBoxIcon.Information);_result =true;}catch(Exception){_result =false;}}
ImportsLeadtoolsImportsLeadtools.MediaStreamingPublic_serverAsServer =NothingPublic_resultAsBoolean=FalsePublicSubPrintLiveStreamsExample()TryDimstrLiveStreamsAsString=""' create an instance of the server object_server =NewLeadtools.MediaStreaming.Server()' retrieve a copy of the Live StreamsDimStreamsAsLiveStreams = _server.GetLiveStreams()strLiveStreams +=String.Format("--- Live Streams (count = {0}) ---"& vbLf & vbLf, Streams.Count.ToString())' print the all live streams properties to a stringFornIndexAsInteger= 0ToStreams.Count- 1DimstreamAsLiveStream = Streams.GetLiveStream(nIndex)strLiveStreams +=String.Format("Live Stream[{0}]: Path = ""{1}""."& vbLf, nIndex.ToString(), stream.Path)DimnSelectionAsInteger= stream.VideoDevices.SelectionDimstrDeviceAsString=""IfnSelection < 0ThenstrDevice =""ElsestrDevice = stream.VideoDevices(nSelection).FriendlyNameEndIfstrLiveStreams +=String.Format("Video Device = ""{0}""."& vbLf, strDevice)nSelection = stream.AudioDevices.SelectionstrDevice =""IfnSelection < 0ThenstrDevice =""ElsestrDevice = stream.AudioDevices(nSelection).FriendlyNameEndIfstrLiveStreams +=String.Format(“音频德维克e = ""{0}""."& vbLf, strDevice)strLiveStreams +=String.Format("Video Width = ""{0}""."& vbLf, stream.VideoWidth.ToString())strLiveStreams +=String.Format("Video Height = ""{0}""."& vbLf, stream.VideoHeight.ToString())Ifstream.UseVideoInputSizeThenstrLiveStreams +=String.Format("Use Video Input Size = ""true""."& vbLf)ElsestrLiveStreams +=String.Format("Use Video Input Size = ""false""."& vbLf)EndIfstrLiveStreams +=String.Format("Video Frame Rate = ""{0}""."& vbLf, stream.VideoFrameRate.ToString())Ifstream.UseVideoInputFrameRateThenstrLiveStreams +=String.Format("Use Video Input Frame Rate = ""true""."& vbLf)ElsestrLiveStreams +=String.Format("Use Video Input Frame Rate = ""false""."& vbLf)EndIfstrLiveStreams +=String.Format(“视频比特率=””“{0}”。"& vbLf, stream.VideoBitRate.ToString())Ifstream.QSVAccelerationThenstrLiveStreams +=String.Format("QSVAcceleration = ""true""."& vbLf)ElsestrLiveStreams +=String.Format("QSVAcceleration = ""false""."& vbLf)EndIfIfstream.CUDAAccelerationThenstrLiveStreams +=String.Format("CUDAAcceleration = ""true""."& vbLf)ElsestrLiveStreams +=String.Format("CUDAAcceleration = ""false""."& vbLf)EndIfnSelection = stream.AudioTypes.SelectionDimstrTypeAsString=""IfnSelection < 0ThenstrType =""ElsestrType = stream.AudioTypes(nSelection).FriendlyNameEndIfIfstream.UseDeviceEncodingThenstrLiveStreams +=String.Format("Use Device Encoding = ""true""."& vbLf)ElsestrLiveStreams +=String.Format("Use Device Encoding = ""false""."& vbLf)EndIfstrLiveStreams +=String.Format("Minimum Fragment Duration = ""{0}""."& vbLf, stream.MinimumFragmentDuration.ToString())Ifstream.EnableThenstrLiveStreams +=String.Format("Enable = ""true""."& vbLf)ElsestrLiveStreams +=String.Format("Enable = ""false""."& vbLf)EndIfIfstream.ActivateOnDemandThenstrLiveStreams +=String.Format("ActivateOnDemand = ""true""."& vbLf)ElsestrLiveStreams +=String.Format("ActivateOnDemand = ""false""."& vbLf)EndIfstrLiveStreams +=String.Format("IdleTimeOut = ""{0}""."& vbLf, stream.IdleTimeOut.ToString())Ifstream.CUDADecodingThenstrLiveStreams +=String.Format("CUDADecoding = ""true""."& vbLf)ElsestrLiveStreams +=String.Format("CUDADecoding = ""false""."& vbLf)EndIfIfstream.QSVDecodingThenstrLiveStreams +=String.Format("QSVDecoding = ""true""."& vbLf)ElsestrLiveStreams +=String.Format("QSVDecoding = ""false""."& vbLf)EndIfIfstream.HasVideoDeviceURLThenstrLiveStreams +=String.Format("VideoDeviceURL = ""{0}""."& vbLf, stream.VideoDeviceURL)EndIfNext' display a message contains the Live Streams information stringMessageBox.Show(strLiveStreams,"LEADTOOLS Media Streaming Examples", MessageBoxButtons.OK, MessageBoxIcon.Information)_result =TrueCatchgeneratedExceptionNameAsException_result =FalseEndTryEndSub
Requirements

Target Platforms

Leadtools.MediaStreaming Assembly
188金宝搏的网址客服|Support|Contact Us|Intellectual Property Notices
© 1991-2021LEAD Technologies, Inc.All Rights Reserved.