Android中关于Audio库的知识

Android会自动扫描外存(SD卡)中的文件,获取到audio类型的文件,分析文件后,将信息数据存储在 MediaStore.Audio.AudioColumns表内,该表的结构如下:

字段包括如下:

Constants
StringALBUMThe album the audio file is from, if any

Type: TEXT

StringALBUM_IDThe id of the album the audio file is from, if any

Type: INTEGER (long)

StringALBUM_KEYA non human readable key calculated from the ALBUM, used for searching, sorting and grouping

Type: TEXT

StringARTISTThe artist who created the audio file, if any

Type: TEXT

StringARTIST_IDThe id of the artist who created the audio file, if any

Type: INTEGER (long)

StringARTIST_KEYA non human readable key calculated from the ARTIST, used for searching, sorting and grouping

Type: TEXT

StringBOOKMARKThe position, in ms, playback was at when playback for this file was last stopped.
StringCOMPOSERThe composer of the audio file, if any

Type: TEXT

StringDURATIONThe duration of the audio file, in ms

Type: INTEGER (long)

StringIS_ALARMNon-zero if the audio file may be an alarm

Type: INTEGER (boolean)

StringIS_MUSICNon-zero if the audio file is music

Type: INTEGER (boolean)

StringIS_NOTIFICATIONNon-zero if the audio file may be a notification sound

Type: INTEGER (boolean)

StringIS_PODCASTNon-zero if the audio file is a podcast

Type: INTEGER (boolean)

StringIS_RINGTONENon-zero if the audio file may be a ringtone

Type: INTEGER (boolean)

StringTITLE_KEYA non human readable key calculated from the TITLE, used for searching, sorting and grouping

Type: TEXT

StringTRACKThe track number of this song on the album, if any.
StringYEARThe year the audio file was recorded, if any

Type: INTEGER

[Collapse]
Inherited Constants
From interfaceandroid.provider.BaseColumns
String_COUNTThe count of rows in a directory.
String_IDThe unique ID for a row.
From interfaceandroid.provider.MediaStore.MediaColumns
StringDATAThe data stream for the file

Type: DATA STREAM

StringDATE_ADDEDThe time the file was added to the media provider Units are seconds since 1970.
StringDATE_MODIFIEDThe time the file was last modified Units are seconds since 1970.
StringDISPLAY_NAMEThe display name of the file

Type: TEXT

StringMIME_TYPEThe MIME type of the file

Type: TEXT

StringSIZEThe size of the file in bytes

Type: INTEGER (long)

StringTITLEThe title of the content

Type: TEXT



类MediaStore.Audio.Media

描述了手机内和SD卡Audio文件的URI
Fields
public static final Uri EXTERNAL_CONTENT_URIThe content:// style URI for the "primary" external storage volume.
public static final Uri INTERNAL_CONTENT_URIThe content:// style URI for the internal storage.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值