导航:首页 > 信息系统 > 如何获取最新音乐的信息

如何获取最新音乐的信息

发布时间:2022-06-25 10:07:54

㈠ 如何获取SD卡中的歌曲详细信息

有两种方法 第一种 sd卡的默认目录是"/mnt/sdcard",只需要 1、File mFile = new File ("/mnt/sdcard"); mFile.listFile就可以遍历出SD一级目录下的所有文件、文件夹。递归实现读取所有文件 2、根据文件后缀名可判断是否为音乐文件(包括mp3、acc等等) 3、提取出音乐文件 第二种方法 下载一个播放器软件,酷狗、天天动听或是QQ音乐,打开后他能够自动扫描出音乐文件。

㈡ android中怎么样能获取正在播放的音乐名

如果我们在此基础上更深入一步,控制音乐播放的同时,我们还需要得到正在播放的音乐名称,这又该怎么实现呢?Android Framework 提供了非常棒的 android.media,凡音乐播放都离不开 MediaPlayer,该类定义了七个内部类,其中 MediaPlayer.OnPreparedListener 是这么描述的:Interface definition for a callback to be invoked when the media source is ready for playback.媒体文件准备结束,准备播放时,Android 就会调用这个这个内部类,在 MediaPlaybackService 则是 notifyChange(String what) 方法进行处理:private void notifyChange(String what) { Intent i = new Intent(what); i.putExtra(”id”, Integer.valueOf(getAudioId())); i.putExtra(”artist”, getArtistName()); i.putExtra(”album”,getAlbumName()); i.putExtra(”track”, getTrackName()); sendBroadcast(i); // …… }那么在我们的应用当中,则需要创建 一个BroadcastReceiver,过滤对应的 action name,也就是常量 META_CHANGED 对应的值即可达到目标。 查看原帖>>

㈢ 网易云音乐怎样查看歌曲详细信息

网易云音乐查看歌曲详细信息的方法:
1、进入网易云音乐,找到你的要查看的歌曲
2、进入播放界面,点击下方的三个点图标
3、即可看到歌曲信息
4、如果想了解更多信息内容,可以点击信息选项
5、如点击专辑,进入专辑界面,可以看到歌曲专辑其它曲目,点击上面的简介,进入歌曲详细专辑信息,包括发行相关资料
6、同理点击歌曲信息的歌手,进入歌手主页,可以看到相对应歌曲的歌手所有作品及个人简介

㈣ android 怎么获取手机内存里的音乐信息

Android自带的音乐播放器中,在获取音乐文件信息的时候是通过扫描得到相关信息的。扫描时使用扫描器MediaScanner完成。
Android系统提供了MediaScanner、MediaProvider、MediaStore等接口,并且提供了一套数据库表格,通过Content Provider的方式提供给用户。当手机开机或者有SD卡插拔等事件发生时,系统将会自动扫描SD卡和手机内存上的媒体文件,如audio、video、图片等,将相应的信息放到定义好的数据库表格中。在这个程序中,我们不需要关心如何去扫描手机中的文件,只要了解如何查询和使用这些信息就可以了。
MediaStore中定义了一系列的数据表格,通过Android ContentResolver提供的查询接口,我们可以得到各种需要的信息。下面我们重点介绍查询SD卡上的音乐文件信息。
先来了解一下ContentResolver的查询接口:
Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder)
Uri:指明要查询的数据库名称加上表的名称,从MediaStore中我们可以找到相应信息的参数。
Projection: 指定查询数据库表中的哪几列,返回的游标中将包括相应的信息。Null则返回所有信息。
selection: 指定查询条件
selectionArgs:参数selection里有 ?这个符号是,这里可以以实际值代替这个问号。如果selection这个没有?的话,那么这个String数组可以为null。
SortOrder:指定查询结果的排列顺序
下面的命令将返回所有在外部存储卡上的音乐文件的信息:
Cursor cursor = query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, null, null, null, MediaStore.Audio.Media.DEFAULT_SORT_ORDER);
得到cursor后,我们可以调用Cursor的相关方法具体的音乐信息:
歌曲ID:MediaStore.Audio.Media._ID
Int id = cursor.getInt(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media._ID));
歌曲的名称:MediaStore.Audio.Media.TITLE
String tilte = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.TITLE));
歌曲的专辑名:MediaStore.Audio.Media.ALBUM
String album = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.ALBUM));

歌曲的歌手名:MediaStore.Audio.Media.ARTIST
String artist = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.ARTIST));

歌曲文件的路径:MediaStore.Audio.Media.DATA
String url = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DATA));
歌曲的总播放时长:MediaStore.Audio.Media.DURATION
Int ration = cursor.getInt(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DURATION));
歌曲文件的大小:MediaStore.Audio.Media.SIZE
Int size = cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.SIZE));

㈤ 音乐播放器是如何获取MP3文件信息的

ID3还有个v2版,位于mp3的开头,foobar2000可以编辑。

㈥ android开发如何获得歌曲信息

你是获取手机内存里面的音乐吗?如果是你应该先获取音乐文件的路径,你在服务中通过mediaplayer.setdatasource(currentMusic.getpath)来获取当前avtivity发送过来的当前音乐对象,在music类中用mediaStrose.Adeio.media来获取音乐文件的歌名,歌手和歌曲存放的路径。

㈦ Android平台中应该如何获取音乐文件的信息

MediaStore中定义了一系列的数据表格,通过ContentResolver提供的查询接口,我们可以得到各种需要的信息。

下面的命令将返回所有在外部存储卡上的音乐文件的信息:

Cursor cursor = query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, null,

null, null, MediaStore.Audio.Media.DEFAULT_SORT_ORDER);

得到cursor后,我们可以调用Cursor的相关方法具体的音乐信息:

㈧ 如何从mp3,wma等音频文件中获取歌曲信息

1 public struct Mp3Info
2
3 {
4
5 public string identify;//TAG,三个字节
6
7 public string Title;//歌曲名,30个字节
8
9 public string Artist;//歌手名,30个字节
10
11 public string Album;//所属唱片,30个字节
12
13 public string Year;//年,4个字符
14
15 public string Comment;//注释,28个字节
16
17
18
19 public char reserved1;//保留位,一个字节
20
21 public char reserved2;//保留位,一个字节
22
23 public char reserved3;//保留位,一个字节
24
25 }
26
27
28 /// <summary>
29
30 /// 获取MP3文件最后128个字节
31
32 /// </summary>
33
34 /// <param name="FileName">文件名</param>
35
36 /// <returns>返回字节数组</returns>
37
38 private byte[] getLast128(string FileName)
39
40 {
41
42 FileStream fs = new FileStream(FileName,FileMode.Open,FileAccess.Read);
43
44 string title = ReadAuthor(fs);
45
46 Stream stream = fs;
47
48
49
50 stream.Seek(-300,SeekOrigin.End);
51
52
53
54 const int seekPos = 300;
55
56 int rl = 0;
57
58 byte[] Info = new byte[seekPos];
59
60 rl = stream.Read(Info,0,seekPos);
61
62
63
64 fs.Close();
65
66 stream.Close();
67
68
69
70 return Info;
71
72 }
73
74 private string ReadAuthor(Stream binary_file)
75 {
76 System.Text.Encoding encoding = System.Text.Encoding.UTF8;
77 // Read string from binary file with UTF8 encoding
78 byte[] buffer = new byte[30];
79 binary_file.Read(buffer, 0, 30);
80 return encoding.GetString(buffer);
81 }
82
83 /// <summary>
84
85 /// 获取MP3歌曲的相关信息
86
87 /// </summary>
88
89 /// <param name = "Info">从MP3文件中截取的二进制信息</param>
90
91 /// <returns>返回一个Mp3Info结构</returns>
92
93 private Mp3Info getMp3Info(byte[] Info)
94
95 {
96
97 Mp3Info mp3Info = new Mp3Info();
98
99
100
101 string str = null;
102
103 int i;
104
105 int position = 0;//循环的起始值
106
107 int currentIndex = 0;//Info的当前索引值
108
109 //获取TAG标识
110
111 for(i = currentIndex;i<currentIndex+3;i++)
112
113 {
114
115 str = str+(char)Info[i];
116
117
118
119 position++;
120
121 }
122
123 currentIndex = position;
124
125 mp3Info.identify = str;
126
127
128
129 //获取歌名
130
131 str = null;
132
133 byte[] bytTitle = new byte[30];//将歌名部分读到一个单独的数组中
134
135 int j = 0;
136
137 for(i = currentIndex;i<currentIndex+30;i++)
138
139 {
140
141 bytTitle[j] = Info[i];
142
143 position++;
144
145 j++;
146
147 }
148
149 currentIndex = position;
150
151 mp3Info.Title = this.byteToString(bytTitle);
152
153
154
155 //获取歌手名
156
157 str = null;
158
159 j = 0;
160
161 byte[] bytArtist = new byte[30];//将歌手名部分读到一个单独的数组中
162
163 for(i = currentIndex;i<currentIndex+30;i++)
164
165 {
166
167 bytArtist[j] = Info[i];
168
169 position++;
170
171 j++;
172
173 }
174
175 currentIndex = position;
176
177 mp3Info.Artist = this.byteToString(bytArtist);
178
179
180
181 //获取唱片名
182
183 str = null;
184
185 j = 0;
186
187 byte[] bytAlbum = new byte[30];//将唱片名部分读到一个单独的数组中
188
189 for(i = currentIndex;i<currentIndex+30;i++)
190
191 {
192
193 bytAlbum[j] = Info[i];
194
195 position++;
196
197 j++;
198
199 }
200
201 currentIndex = position;
202
203 mp3Info.Album = this.byteToString(bytAlbum);
204
205
206
207 //获取年
208
209 str = null;
210
211 j = 0;
212
213 byte[] bytYear = new byte[4];//将年部分读到一个单独的数组中
214
215 for(i = currentIndex;i<currentIndex+4;i++)
216
217 {
218
219 bytYear[j] = Info[i];
220
221 position++;
222
223 j++;
224
225 }
226
227 currentIndex = position;
228
229 mp3Info.Year = this.byteToString(bytYear);
230
231
232
233 //获取注释
234
235 str = null;
236
237 j = 0;
238
239 byte[] bytComment = new byte[28];//将注释部分读到一个单独的数组中
240
241 for(i = currentIndex;i<currentIndex+25;i++)
242
243 {
244
245 bytComment[j] = Info[i];
246
247 position++;
248
249 j++;
250
251 }
252
253 currentIndex = position;
254
255 mp3Info.Comment = this.byteToString(bytComment);
256
257
258
259 //以下获取保留位
260
261 mp3Info.reserved1 = (char)Info[++position];
262
263 mp3Info.reserved2 = (char)Info[++position];
264
265 mp3Info.reserved3 = (char)Info[++position];
266
267
268
269 return mp3Info;
270 }
271
272 /// <summary>
273
274 /// 将字节数组转换成字符串
275
276 /// </summary>
277
278 /// <param name = "b">字节数组</param>
279
280 /// <returns>返回转换后的字符串</returns>
281
282 private string byteToString(byte[] b)
283
284 {
285 Encoding enc = Encoding.GetEncoding("GB2312");
286
287
288 string str = enc.GetString(b);
289
290 str = str.Substring(0,str.IndexOf('\0') >= 0 ? str.IndexOf('\0') : str.Length);//去掉无用字符
291
292
293
294 return str;
295
296 }

㈨ 你是在哪里获得的这些流行音乐信息啊

可以把杂志与上网看到的筛选一下网站你可以选酷狗,qq音乐等
这里给你推荐一些:Dima Bilan这个人的很多歌都好听如:In Circles,lady(remix版)等特别是mulatka这个的风格是blue很好听!

㈩ 可以通过哪些途径获得新音乐

我可以忍住很多事不去做,但是就是不能忍住不听音乐,如今越来越多的人喜欢听音乐,而因为手机偏于携带,所以大家都喜欢把音乐下载到手机里边随时享受,下面就介绍一些获取新音乐的途径。


与喜欢的音乐不期而遇

根据你的口味,豆瓣会推荐适合的唱片给你

个性化收听

每一个操作都会带来更懂你的音乐

多种多样的风格

海量数据帮助你找到符合口味的音乐

现在有音乐播放器,QQ音乐、虾米音乐等平台,都是现在音乐推广最重要的渠道 无论是那种途径,遇见了喜欢的音乐就记下来,有空搜索一下就有了,不断寻找的过程中你慢慢就拥有了更多新的音乐。

阅读全文

与如何获取最新音乐的信息相关的资料

热点内容
如何用程序发送生日表情 浏览:918
贵州哪里有鸡排技术培训 浏览:22
pom材料产品尺寸怎么调整 浏览:467
车床如何建立一个新程序 浏览:413
苹果手机流量数据显示哪里 浏览:48
武汉化石交易市场在哪里 浏览:903
永定工业产品农产品有哪些 浏览:593
第五人格如何把道具剩余多少信息发出来 浏览:489
虎丘爆店码代理怎么开通 浏览:470
有哪些模拟绝密电子技术 浏览:831
怎么代理思端口产品 浏览:89
如何成为黄金交易所会员 浏览:649
清除应用程序什么意思 浏览:604
天津招收程序员哪个区最多 浏览:361
淘宝调数据一般收多少钱 浏览:171
液压油西安哪里有市场 浏览:141
华为应用市场怎么更新抖音 浏览:643
沈航焊接技术是哪个学院 浏览:513
关于砖回弹法的数据分析包括哪些 浏览:158
网上的丰胸产品怎么不可以吃辣椒 浏览:966