阅读ID3标签Xamarin / Android的? [英] Reading ID3 tags in Xamarin/Android?

查看:192
本文介绍了阅读ID3标签Xamarin / Android的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能吗?有多容易?

我加入TaglibSharp,一个ID3库C#我已经用于.NET应用程序很长一段时间的参考,但它不是活动/任何类中检测到。标签库是专为(我认为)单声道/ .NET 3.5,但我假设它需要重建为Android? (我打开了图书馆的来源和平台的唯一选择在Visual Studio和Xamarin是单声道和.NET的变化)

I added a reference to TaglibSharp, an ID3 library for C# I've used for a long time in .NET applications, but it isn't detected within the activity/any classes. Taglib is built for (I think) Mono/.NET 3.5, but I'm assuming it needs to be "rebuilt" for Android? (I opened up the library's source and the only options for platform in Visual Studio and Xamarin are variations of Mono and .NET)

如果有标签库的工作的可能性也不大,因为它不会结束了Android平台上工作,有另一种方式?我搜索pretty大量用于Xamarin支持ID3和所有我发现是的这个

If working with Taglib isn't a possibility because it wouldn't end up working on the Android platform, is there another way? I've searched pretty extensively for Xamarin ID3 support and all I've found is this.

有人能指出我在正确的方向?

Can someone point me in the right direction?

推荐答案

您应该能够使用的 Android.Media.MediaMetadataRetriever 类来读取你需要的所有信息。

You should be able to use the Android.Media.MediaMetadataRetriever class to read all the information you need.

下面是如何让一个文件的标题为例,

Here's an example to how to get the title of a file,

MediaMetadataRetriever reader = new MediaMetadataRetriever();

reader.setDataSource("some file path");

String title = reader.extractMetadata(MediaMetadataRetriever.METADATA_KEY_TITLE);


MediaMetadataRetriever.extractMetadata()选项,


      
  • MetadataKeyAlbum :元数据关键检索
      有关数据源的专辑标题的信息。

  • MetadataKeyAlbum: The metadata key to retrieve the information about the album title of the data source.

MetadataKeyAlbumartist :元数据关键
  检索相关的表演或艺术家的信息
  与数据源

MetadataKeyAlbumartist: The metadata key to retrieve the information about the performers or artist associated with the data source.

MetadataKeyArtist :元数据关键检索
  有关数据源的艺术家的信息。

MetadataKeyArtist: The metadata key to retrieve the information about the artist of the data source.

MetadataKeyAuthor :元数据关键检索
  有关数据源的作者的信息。

MetadataKeyAuthor: The metadata key to retrieve the information about the author of the data source.

MetadataKeyBitrate :此键检索
  平均比特率(以比特/秒),如果有的话。

MetadataKeyBitrate: This key retrieves the average bitrate (in bits/sec), if available.

MetadataKeyCdTrackNumber :元数据
  键来检索描述音频的顺序数字小串
  其原始的录音数据源。

MetadataKeyCdTrackNumber: The metadata key to retrieve the numberic string describing the order of the audio data source on its original recording.

MetadataKeyCompilation :元数据关键
  检索音乐专辑编辑状态。

MetadataKeyCompilation: The metadata key to retrieve the music album compilation status.

MetadataKeyComposer :元数据关键
  检索有关数据源的作曲家的信息。

MetadataKeyComposer: The metadata key to retrieve the information about the composer of the data source.

MetadataKeyDate :元数据关键检索
  创建或修改数据源时的日期。

MetadataKeyDate: The metadata key to retrieve the date when the data source was created or modified.

MetadataKeyDiscNumber :元数据关键
  检索描述一组的哪一部分数字字符串
  音频数据源从何而来。

MetadataKeyDiscNumber: The metadata key to retrieve the numeric string that describes which part of a set the audio data source comes from.

MetadataKeyDuration :元数据关键
  检索数据源的再现持续时间。

MetadataKeyDuration: The metadata key to retrieve the playback duration of the data source.

MetadataKeyGenre :元数据关键检索
  数据源的内容类型或流派。

MetadataKeyGenre: The metadata key to retrieve the content type or genre of the data source.

MetadataKeyHasAudio :如果该键存在
  媒体包含音频内容。

MetadataKeyHasAudio: If this key exists the media contains audio content.

MetadataKeyHasVideo :如果该键存在
  介质包含视频内容。

MetadataKeyHasVideo: If this key exists the media contains video content.

MetadataKeyMimetype :元数据关键
  检索数据源的MIME类型。

MetadataKeyMimetype: The metadata key to retrieve the mime type of the data source.

MetadataKeyNumTracks :元数据关键
  检索的曲目,如音频,视频,文本的数目,在数据
  源,如MP4或3GPP文件。

MetadataKeyNumTracks: The metadata key to retrieve the number of tracks, such as audio, video, text, in the data source, such as a mp4 or 3gpp file.

MetadataKeyTitle :元数据关键检索
  数据源标题。

MetadataKeyTitle: The metadata key to retrieve the data source title.

MetadataKeyVideoHeight :如果媒体包含
  视频,该键检索它的高度。

MetadataKeyVideoHeight: If the media contains video, this key retrieves its height.

MetadataKeyVideoWidth :如果媒体包含
  视频,该键检索它的宽度。

MetadataKeyVideoWidth: If the media contains video, this key retrieves its width.

MetadataKeyWriter :元数据关键检索
  作者的数据源的信息(如作词)。

MetadataKeyWriter: The metadata key to retrieve the information of the writer (such as lyricist) of the data source.

MetadataKeyYear :元数据键来检索年创建或修改数据源时

MetadataKeyYear: The metadata key to retrieve the year when the data source was created or modified.

来源。

这篇关于阅读ID3标签Xamarin / Android的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆