代码之家  ›  专栏  ›  技术社区  ›  Nasenbaer

在Silverlight中读取MP3标记属性

  •  0
  • Nasenbaer  · 技术社区  · 15 年前

    我知道在silverlight中读取MP3标签属性MP3V1是有效的。我知道它没有任何第三方模块。但是当我像微软描述的那样使用MP3工作流时,我总是在MP3文件中得到零属性的计数。

    项目示例: http://www.file-upload.net/download-2617219/Elenor_techno.mp3.html

    <UserControl x:Class="MP3_Tag_test.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    
    <Grid x:Name="LayoutRoot" Background="White" Margin="12">
        <StackPanel Orientation="Vertical">
            <MediaElement x:Name="MediaHelper" Visibility="Visible" />
            <TextBlock x:Name="txtTitle" Text="Title" FontSize="28" />
            <Button Content="STOP" Height="23" HorizontalAlignment="Left" Name="Button3" Width="75" />
            <Button Content="Play MP3" Height="23" HorizontalAlignment="Left" Name="Button1" VerticalAlignment="Top" Width="75" Margin="0,20,0,0" />
            <Button Content="Play stream" Height="23" HorizontalAlignment="Left" Name="Button2" VerticalAlignment="Top" Width="75" />
        </StackPanel>
    </Grid>
    

    Partial Public Class MainPage
    Inherits UserControl
    
    Public Sub New()
        InitializeComponent()
    End Sub
    
    Private Sub MainPage_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
    
    End Sub
    
    Private Sub MediaHelper_CurrentStateChanged(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles MediaHelper.CurrentStateChanged
        If Me.MediaHelper.Attributes.ContainsKey("Title") Then Me.txtTitle.Text = Me.MediaHelper.Attributes("Title")
    End Sub
    
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click
        Me.txtTitle.Text = "Loading mp3..."
    
        Me.MediaHelper.Source = New Uri("http://dave-d.ch/database/music/public/1000036869_stefan%20lange%20koolja.mp3")
        Me.MediaHelper.Play()
    End Sub
    
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button2.Click
        Me.txtTitle.Text = "Loading stream..."
    
        Me.MediaHelper.Source = New Uri("http://asx.skypro.ch/radio/internet-128/fm1-nord.asx")
        Me.MediaHelper.Play()
    End Sub
    
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button3.Click
        Me.MediaHelper.Stop()
    End Sub 
    

    结束类

    1 回复  |  直到 15 年前
        1
  •  0
  •   Nasenbaer    15 年前

    好 啊。我创建了自己的类,现在我通过服务将MP3标签提交到Silverlight页面。但我还是对Silverlight标签阅读器不工作感兴趣。

    推荐文章