Propiedad IWMPNetwork::bitRate

[La característica asociada a esta página, Reproductor multimedia de Windows SDK, es una característica heredada. Se ha reemplazado por MediaPlayer. MediaPlayer se ha optimizado para Windows 10 y Windows 11. Microsoft recomienda encarecidamente que el nuevo código use MediaPlayer en lugar de Reproductor multimedia de Windows SDK, siempre que sea posible. Microsoft sugiere que el código existente que usa las API heredadas se reescriba para usar las nuevas API si es posible.

La propiedad bitRate obtiene la velocidad de bits actual que se recibe.

Sintaxis

public System.Int32 bitRate {get; set;}

Public ReadOnly Property bitRate As System.Int32

Valor de propiedad

System.Int32 que es la velocidad de bits.

Observaciones

El valor de esta propiedad es una combinación de las velocidades de bits de las secuencias de vídeo y audio.

Ejemplos

En el ejemplo siguiente se usa bitRate para mostrar la velocidad de bits multimedia actual. La información se muestra en una etiqueta en respuesta al evento PlayStateChange . El objeto AxWMPLib.AxWindowsMediaPlayer se representa mediante la variable denominada player.

// Add a delegate for the PlayStateChange event.
player.PlayStateChange += new AxWMPLib._WMPOCXEvents_PlayStateChangeEventHandler(player_PlayStateChange);

// Create an event handler for the PlayStateChange event.
private void player_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e)
{
    // Display the bitRate when the player is playing. 
    switch (e.newState)
    {
        case 3:  // Play State = WMPLib.WMPPlayState.wmppsPlaying = 3
            if (player.network.bitRate != 0)
            {
                bitRateLabel.Text = "Current Bit Rate: " + player.network.bitRate + " K bits/second";
            }
            break;

        default:
            break;
    }
}

' Create an event handler for the PlayStateChange event.
Public Sub player_PlayStateChange(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) Handles player.PlayStateChange

    ' Display the bitRate when the player is playing. 
    Select Case e.newState

        Case 3 ' Play State = WMPLib.WMPPlayState.wmppsPlaying = 3

            If (player.network.bitRate <> 0) Then

                bitRateLabel.Text = &quot;Current Bit Rate: &quot; + player.network.bitRate + &quot; K bits/second&quot;

            End If

    End Select

End Sub

Requisitos

Requisito Value
Versión
Reproductor multimedia de Windows serie 9 o posterior
Espacio de nombres
WMPLib
Ensamblado
Interop.WMPLib.dll (Interop.WMPLib.dll.dll)

Consulte también

Interfaz IWMPNetwork (VB y C#)