First, we read the file from the SD card to play the file !!
1 ,:
Work in advance and put music files into the SD card,
2. layout file main. xml
3. Activity
Package CN. csdn. activity; import Java. io. file; import Java. io. ioexception; import Java. util. timer; import Java. util. timertask; import android. app. activity; import android. media. mediaplayer;
HTML5 graphic tutorial for creating a cool Audio Player Plug-in,This tutorial mainly aims to demonstrate the use of HTML 5's new tags and the Dom API of audio elements. It provides a detailed explanation and the sample code. If you need it, refer to it.
This is the UI of the audio player, which also hides the playing
Android game background music audio volume control, android volume control
Game sound effects are the music we use to play games. This is also a must-have for every game. However, if the background music you play is interrupted, we can use getCurrentPosition () this method i
Playing background music in androidAfter referring to what was written on the internet, I used it to play music in a new thread. Later I found that every time I entered the Activity, I would start playing a music again. To avoid repeated playback, I added the singleton mode based on the original code. This avoids repeated playback.
Package com. liu. zhen. utils;
This article is translated from orx tutorials sound and music),~ Dai Yi ~ Translation. For the latest version, see orx Chinese wiki.. (Because the format is not easy to read here, it is recommended to go to the official wiki to view it) This article is transferred from ~ Dai Yi ~ Blog
. Original link in: http://blog.csdn.net/v_023/archive/2010/07/06/5717261.aspx.
Sound and music
(Sound
Android music garbled problem modification, android garbled
The following is a summary of the garbled modification of music names, albums, and music in the Android music
(), you must call mplayer. prepare () // method 2 start mplayer = new MediaPlayer (); try {FileDescriptor fd = getResources (). openRawResourceFd (R. raw. lost ). getFileDescriptor (); // obtain the music data source mplayer. setDataSource (fd); // you can specify mplayer as the data source. setLooping (true); // set to loop playback} catch (IOException e) {// TODO Auto-generated catch bloc K e. printStackTrace ();} // method 2 end Log. I (TAG, "
The image above is the UI diagram of the audio player, which also hides a playlist of songs. The entire player's UI in addition to the big background portrait and the song Star score uses the picture other all by the CSS and the font-face to draw, the only thing that seems to be difficult is the production of CDs and Saucers, which are animated interactively when the song is played. This will be explained in the following section. Click on the
Recently I made an android music player. I personally felt that the most difficult part was "playing back" and "playing list", but I finally found the implementation method. Different people may implement different methods. Here I will share some of my implementation methods for the "playlist" module. "playing back" will be introduced in the next blog, I hope you
= = null) {LOG.E (TAG, "playbackgroundmusic:background Media Player is null");} else {//If music is being broadcast Put or nearly interrupted, stop it---if the music is playing or paused, stop itmbackgroundmediaplayer.stop (); mbackgroundmediaplayer.setlooping (isloop); try {mbackgroundmediaplayer.prepare (); mbackgroundmediaplayer.seekto (0); Mbackgroundmediapl
Service translated into Chinese is the services, familiar with the Windows system students must be very familiar with. The service in Android is similar to the service function in Windows, where an invisible process executes in the background.Android services, it is different from the activity, it can not interact with the user, can not be started, run in the background of the program, if we quit the application, the service process does not end, it s
create the directory raw in res, and then add MP3 files to it.
Inherit a service class:
Package COM. moruna. studys; import android. app. service; import android. content. intent; import android. media. mediaplayer; import android. OS. ibinder; public class myservice extends Service {private mediaplayer MP; @ overrid
Developers of Android PC OS remix OS today announced the launch of Remixos Player, which allows users to run Android apps in Windows (Getting Started tutorial ty300.com). Remixos player is essentially an Android emulator, although
add some beautiful girls to the background, just add background to the layout file. Here we will focus on logic, if you don't talk about these fancy things, how can you switch from the first activity to the second activity? We need to use our powerful Intent. Intent can implement the conversion of one activity to another. When you click a song, the playing interface needs to know that you are playing the magic horse. A series of Song information needs to be passed to the second interface. This
To play an audio file, you can use the built-in Music function to play the audio file) "function of the application-that is, use the built-in or installed music player to play the specified audio file.
This example is relatively simple. The source code is provided below:
Layout file activity_main:
Code File MainActivity:
Package com. mutime
PrefaceIn order to ensure the progress of each Monday article, and because the new Vitamio version is not released, it is decided to delay some local playback functions (, video time, size, etc.), skip the section that directly writes the online playback part. From the introduction of Vitamio, we can see that it supports multiple network protocols such as http and m3u8. This chapter will compile an example of playing Youku videos.
StatementWelcome to repost, but please keep the original source o
This article is an example of how Android is based on the service to implement music background playback. Share to everyone for your reference, specific as follows:
Service is a long life cycle and there is no user interface program, when the program in each activity switch, we can use the service to achieve background music playback, even when the program quit
This article mainly introduces the basic tutorial of jQuery-based webpage Audio and Video Player jPlayer. The example in this article mainly describes how to play audio files. For more information, see
JPlayer introduction:
If you want to play background music on a webpage, you don't want to use the html Tag, because it can only be played after all the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.