Package android.media 翻译

<!-- @page { margin: 0.79in } P { margin-bottom: 0.08in } H1 { margin-bottom: 0.08in } H1.western { font-family: "Times New Roman", serif } H1.cjk { font-family: "DejaVu Sans" } H1.ctl { font-family: "Lohit Hindi" } H2 { margin-bottom: 0.08in } H2.ctl { font-family: "Lohit Hindi" } TD P { margin-bottom: 0in } CODE.cjk { font-family: "DejaVu Sans", monospace } A:link { so-language: zxx } -->

 

工作中使用到所以顺便翻了一下,由于本人水平有限所以以下翻译中不够完善处请包含。

 

欢迎与我联系指正,谢谢。

 

 

package

android.media

提供用于管理音频和视频媒体的接口和类。这个媒体APIs是用于播放并且记录媒体文件。包括音频(例如:播放MP3s或者其他音乐文件,铃声,游戏音效,或者DTMF双音多频声道)以及视频(例如:播放来自于web或者本地的视频流)。

 

Provides classes that manage various media interfaces in audio and video.

The Media APIs are used to play and, in some cases, record media files. This includes audio (e.g., play MP3s or other music files, ringtones, game sound effects, or DTMF tones) and video (e.g., play a video streamed over the web or from local storage).

其他在这个包中的特殊类提供能够在位图中检测人脸(FaceDetector,控制音频路由选择(对于终端或手持设备)以及控制警告如铃声和电话震动(AudioManager.

Other special classes in the package offer the ability to detect the faces of people in Bitmaps (FaceDetector), control audio routing (to the device or a headset) and control alerts such as ringtones and phone vibrations (AudioManager).

Interfaces

AudioManager.OnAudioFocusChangeListener

接口定义于当音频在系统中的聚焦被更新则被回调

Interface definition for a callback to be invoked when the audio focus of the system is updated. 

AudioRecord.OnRecordPositionUpdateListener

 

接口定义于当一个音频录音已经到达由setNotificationMarkerPosition(int)设置的通知标记或者由setPositionNotificationPeriod(int)设置在记录头部的过程中周期性更新

时则被回调

Interface definition for a callback to be invoked when an AudioRecord has reached a notification marker set bysetNotificationMarkerPosition(int) or for periodic updates on the progress of the record head, as set bysetPositionNotificationPeriod(int)

AudioTrack.OnPlaybackPositionUpdateListener

 

接口定义于当回放一个音频音轨的头部位置已经到达一个通知标记或者

已经增加一个确定周期时被回调。

Interface definition for a callback to be invoked when the playback head position of an AudioTrack has reached a notification marker or has increased by a certain period. 

JetPlayer.OnJetEventListener

 

JET引擎发生一个事件时获得这个通知

Handles the notification when the JET engine generates an event. 

MediaPlayer.OnBufferingUpdateListener

 

接口定义于显示一个在网络上的媒体资源流的缓存状态时被回调

Interface definition of a callback to be invoked indicating buffering status of a media resource being streamed over the network. 

MediaPlayer.OnCompletionListener

 

接口定义当一个媒体资源的回放已经完成时被回调

Interface definition for a callback to be invoked when playback of a media source has completed. 

MediaPlayer.OnErrorListener

 

接口定义当在异步操作中有一个错误(其他错误将在方法调用时抛出)时被回调

Interface definition of a callback to be invoked when there has been an error during an asynchronous operation (other errors will throw exceptions at method call time). 

MediaPlayer.OnInfoListener

 

接口定义一些关于媒体或者它的回放的信息且/或警告的通讯时被回调

Interface definition of a callback to be invoked to communicate some info and/or warning about the media or its playback. 

MediaPlayer.OnPreparedListener

 

接口定义当媒体源为回放已准备好时被回调

Interface definition for a callback to be invoked when the media source is ready for playback. 

MediaPlayer.OnSeekCompleteListener

 

接口定义显示一个操作完成时被回调

Interface definition of a callback to be invoked indicating the completion of a seek operation. 

MediaPlayer.OnVideoSizeChangedListener

 

接口定义当视频尺寸是首次知道或者被更新时被回调

Interface definition of a callback to be invoked when the video size is first known or updated  

MediaRecorder.OnErrorListener

 

接口定义当记录时一个错误发生时被回调

Interface definition for a callback to be invoked when an error occurs while recording. 

MediaRecorder.OnInfoListener

 

接口定义当记录时一个错误发生时被回调

Interface definition for a callback to be invoked when an error occurs while recording. 

MediaScannerConnection.MediaScannerConnectionClient

 

一个接口用于通知媒体扫描链接MediaScannerConnection的客户端当到媒体扫描仪MediaScanner服务的连接已经被创立并且当文件的扫描已经完成时。

An interface for notifying clients of MediaScannerConnection when a connection to the MediaScanner service has been established and when the scanning of a file has completed. 

MediaScannerConnection.OnScanCompletedListener

 

接口通知客户端扫描一个请求的媒体文件的结果

Interface for notifying clients of the result of scanning a requested media file. 

SoundPool.OnLoadCompleteListener

 

接口定义当所有声音被装载时被回调

Interface definition for a callback to be invoked when all the sounds are loaded. 

Classes

AsyncPlayer

播放一系列音频URIs, 但在其他线程上做所有困难的工作以便于在预处理或载入是的任何缓慢而使播放线程不至阻塞

Plays a series of audio URIs, but does all the hard work on another thread so that any slowness with preparing or loading doesn't block the calling thread. 

AudioFormat

 

这个AudioFormat类是被有权使用许多音频格式和频道配置常量

The AudioFormat class is used to access a number of audio format and channel configuration constants. 

AudioManager

 

AudioManager提供进入音量和铃声模式控制

AudioManager provides access to volume and ringer mode control. 

AudioRecord

 

这个AudioRecord类管理音频资源对于Java应用采用音频输入硬件架构记录的音频

The AudioRecord class manages the audio resources for Java applications to record audio from the audio input hardware of the platform. 

AudioTrack

 

这个AudioTrack类管理并通过Java应用程序播放一个单个音频资源

The AudioTrack class manages and plays a single audio resource for Java applications. 

CamcorderProfile

 

这个CamcorderProfile类用于取回预定义摄像机描述设置用于摄像机应用

The CamcorderProfile class is used to retrieve the predefined camcorder profile settings for camcorder applications. 

CameraProfile

 

这个CameraProfile类用于取回预定义静态图像照片(jpeg)品质等级(0-100)用于低、中、高质量设置在相机应用中

The CameraProfile class is used to retrieve the pre-defined still image capture (jpeg) quality levels (0-100) used for low, medium, and high quality settings in the Camera application. 

ExifInterface

 

这是一个读写JPEG文件中Exif标签的类

This is a class for reading and writing Exif tags in a JPEG file. 

FaceDetector

 

标识在位图中人脸图形对象

Identifies the faces of people in a Bitmap graphic object. 

FaceDetector.Face

 

在位图中的一个脸包含了所有信息标识

A Face contains all the information identifying the location of a face in a bitmap. 

JetPlayer

 

JetPalyer提供进入JET内容回放和控制

JetPlayer provides access to JET content playback and control. 

MediaMetadataRetriever

 

MediaMetadataRetriever类提供一个统一接口用于取回框架和来自一个输入媒体文件的元数据

MediaMetadataRetriever class provides a unified interface for retrieving frame and meta data from an input media file. 

MediaPlayer

 

MediaPlayer类能用于控制回放音频/视频文件和流

MediaPlayer class can be used to control playback of audio/video files and streams. 

MediaRecorder

 

用于记录音频和视频

Used to record audio and video. 

MediaRecorder.AudioEncoder

 

定义音频编码

Defines the audio encoding. 

MediaRecorder.AudioSource

 

定义音频源

Defines the audio source. 

MediaRecorder.OutputFormat

 

定义输出格式

Defines the output format. 

MediaRecorder.VideoEncoder

 

定义视频编码

Defines the video encoding. 

MediaRecorder.VideoSource

 

定义视频源

Defines the video source. 

MediaScannerConnection

 

MediaScannerConnection提供一个途径为应用程序通过一个新建立或者下载的媒体问题到媒体扫描仪服务

MediaScannerConnection provides a way for applications to pass a newly created or downloaded media file to the media scanner service. 

Ringtone

 

铃声提供一个快速方法用于播放铃声,通知,或其他类似的声音类型

Ringtone provides a quick method for playing a ringtone, notification, or other similar types of sounds. 

RingtoneManager

 

RingtoneManager提供有权使用铃声,通知,和其他声音类型

RingtoneManager provides access to ringtones, notification, and other types of sounds. 

SoundPool

 

这个SoundPool类管理并为应用程序播放音频资源

The SoundPool class manages and plays audio resources for applications. 

ThumbnailUtils

 

为媒体提供缩略图生成程序。

Thumbnail generation routines for media provider. 

ToneGenerator

 

这个类提供方法来播放双音多频声音(ITU-T 推荐 Q.23,调监控音(3GPP TS 22.001CEPT)及专有音(3GPP TS 31.111

This class provides methods to play DTMF tones (ITU-T Recommendation Q.23), call supervisory tones (3GPP TS 22.001, CEPT) and proprietary tones (3GPP TS 31.111). 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
package com.music.zhangdaosen; import android.annotation.SuppressLint; import android.content.ContentResolver; import android.content.Context; import android.database.Cursor; import android.net.Uri; import android.provider.MediaStore; import android.util.Log; import android.widget.ArrayAdapter; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; public class SongHelper { public static List<Song>musicList = new ArrayList<>(); // static List<Song>musicList; public static List<Song> getLocalMusic(Context context){ Uri uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; ContentResolver resolver = context.getContentResolver(); Cursor cursor = resolver.query(uri,null,null,null,null); if(cursor !=null){ Song song; while (cursor.moveToNext()){ song =new Song(); int index = cursor.getColumnIndex(MediaStore.Audio.Media.DISPLAY_NAME); song.name = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DISPLAY_NAME)); song.singer = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.ARTIST)); song.path = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DATA)); song.duration = cursor.getInt(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DURATION)); Log.d("SongHelper--keyar","get"+song.name+" "+song.duration); musicList.add(song); SimpleDateFormat sdf = new SimpleDateFormat("mm:ss"); String time = sdf.format(new Date(song.duration)); } Log.d("SongHelper--keyar","get musicList"+ musicList.size()); } cursor.close(); return musicList; } public static String changeTime(int duration){ int min = duration/1000/60; int sec = duration/1000%60; if(sec<10){ return min+":0"+sec; } return min+":"+sec; } }
06-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值