Verzeichnis suchen
android Manifest Manifest.permission Manifest.permission_group android.accessibilityservice AccessibilityService android.accounts Account android.app NotificationManager android.bluetooth BluetoothAdapter BluetoothClass BluetoothClass.Device BluetoothClass.Device.Major BluetoothClass.Service BluetoothDevice BluetoothServerSocket BluetoothSocket android.content SharedPreferences android.database.sqlite SQLiteCursorDriver SQLiteOpenHelper android.graphics Bitmap android.location LocationListener Geocoder GpsStatus GpsStatus.Listener GpsStatus.NmeaListener GpsSatellite android.media AudioFormat AsyncPlayer AudioRecord AudioRecord.OnRecordPositionUpdateListener ThumbnailUtils AudioManager android.net TrafficStats MailTo LocalSocket android.os AsyncTask AsyncTask.Status CountDownTimer Message MessageQueue HandlerThread android.text Html android.util JsonWriter android.view ContextMenu ContextMenu.ContextMenuInfo Display ViewManager View ViewStub ViewTreeObserver ViewParent WindowManager GestureDetector Gravity MenuInflater ScaleGestureDetector SoundEffectConstants android.view.inputmethod InputConnection InputMethod InputMethodSession BaseInputConnection InputMethodManager android.widget AbsListView AbsListView.LayoutParams AbsListView.OnScrollListener AbsListView.RecyclerListener AbsoluteLayout AbsoluteLayout.LayoutParams AbsSeekBar AbsSpinner AdapterView AdapterView.AdapterContextMenuInfo AdapterView.OnItemLongClickListener AdapterView.OnItemSelectedListener AdapterView.OnItemClickListener AnalogClock BaseAdapter BaseExpandableListAdapter Button CheckBox CheckedTextView Checkable Chronometer Chronometer.OnChronometerTickListener CompoundButton CompoundButton.OnCheckedChangeListener CursorAdapter CursorTreeAdapter DatePicker DatePicker.OnDateChangedListener DialerFilter DigitalClock EditText Filter Filter.FilterListener Filter.FilterResults ExpandableListAdapter ExpandableListView.OnChildClickListener ExpandableListView.OnGroupClickListener ExpandableListView.OnGroupCollapseListener ExpandableListView.OnGroupExpandListener Filterable Gallery Gallery.LayoutParams GridView GridLayout GridLayout.Alignment RadioGroup ImageView ImageView.ScaleType HorizontalScrollView ImageButton ImageSwitcher FilterQueryProvider ListAdapter ListView MediaController MultiAutoCompleteTextView MultiAutoCompleteTextView.CommaTokenizer MultiAutoCompleteTextView.Tokenizer QuickContactBadge RadioButton RatingBar RatingBar.OnRatingBarChangeListener RelativeLayout RemoteViews ResourceCursorAdapter ResourceCursorTreeAdapter Scroller ScrollView SearchView SearchView.OnCloseListener SearchView.OnQueryTextListener SearchView.OnSuggestionListener SeekBar SeekBar.OnSeekBarChangeListener SimpleAdapter SimpleAdapter.ViewBinder SimpleCursorAdapter SimpleCursorAdapter.CursorToStringConverter SimpleCursorAdapter.ViewBinder SimpleCursorTreeAdapter SimpleCursorTreeAdapter.ViewBinder SimpleExpandableListAdapter SlidingDrawer SlidingDrawer.OnDrawerCloseListener SlidingDrawer.OnDrawerOpenListener SlidingDrawer.OnDrawerScrollListener Spinner SpinnerAdapter WrapperListAdapter TabHost TabHost.TabSpec TextView TimePicker TimePicker.OnTimeChangedListener Toast TableLayout TableLayout.LayoutParams TableRow TableRow.LayoutParams TabWidget TextSwitcher ToggleButton TwoLineListItem VideoView ViewAnimator ViewFlipper ViewSwitcher ViewSwitcher.ViewFactory ZoomButtonsController ZoomButtonsController.OnZoomListener ZoomButton ZoomControls dalvik.system DexFile
Figuren


AsyncPlayer

版本:Android 3.0 r1

结构

继承关系

public class AsyncPlayer extends Object

java.lang.Object

android.media.AsyncPlayer

类概述

播放一个连续(多个)的音频URLs,但那些任务较重的工作在另外的线程中完成,所以任何预处理或加载的延迟都不阻碍线程调用。

构造函数

public AsyncPlayer (String tag)

构造一个AsyncPlayer对象。

参数

tag 用于调试的字符串

公共方法

public void play (Context context, Uri uri, boolean looping, int stream)

开始播放声音。可在某个点上开始播放。这里不保证可能有延迟。在另一个音频文件播放时调用这个方法将导致当前音频停止播放并开始播放新的音频。

参数

context 应用程序上下文

uri 播放的 URI (参见setDataSource(Context, Uri))

looping 是否无限循环播放声音。 (参见setLooping(boolean))

stream 音频流(AudioStream)类型 (参见setAudioStreamType(int))(译者注:例如AudioManager.STREAM_MUSIC

public void stop ()

停止之前播放的声音。不能在某点上暂停然后接着播放。多次调用没有不良影响。

补充

文章精选

android多媒体-----AsyncPlayer

Android游戏开发之旅16 异步音乐播放 [Android123]

今天犯了一个愚蠢的错误


Vorheriger Artikel: Nächster Artikel: