導航:首頁 > 信息系統 > 如何獲取最新音樂的信息

如何獲取最新音樂的信息

發布時間: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音樂、蝦米音樂等平台,都是現在音樂推廣最重要的渠道 無論是那種途徑,遇見了喜歡的音樂就記下來,有空搜索一下就有了,不斷尋找的過程中你慢慢就擁有了更多新的音樂。

閱讀全文

與如何獲取最新音樂的信息相關的資料

熱點內容
某派的產品怎麼樣 瀏覽:77
場內交易的貨基有哪些 瀏覽:62
飛機代理設置如何操作 瀏覽:697
如何修改行駛證車輛信息 瀏覽:393
掃地機器人怎麼獲得代理 瀏覽:658
二維碼包括多少個人信息 瀏覽:155
養殖蚯蚓技術到哪裡學 瀏覽:327
如何發信息開玩笑 瀏覽:26
周邊代理怎麼賺錢 瀏覽:701
幻雨技術怎麼樣 瀏覽:826
遼寧號釋放什麼信息 瀏覽:369
撫順二手市場哪個最好 瀏覽:416
有哪些發掘需求數據的工具 瀏覽:747
平和哪裡可以古董交易 瀏覽:445
凱爾特人為什麼被交易 瀏覽:712
定製白酒代理利潤多少 瀏覽:51
如何判斷有沒有高新技術企業 瀏覽:797
依雲是如何進行市場細分的 瀏覽:886
技術部門領導要看哪些書 瀏覽:268
貨車刷數據看哪裡知道符合不 瀏覽:102