本文整理汇总了Java中android.media.MediaActionSound.play方法的典型用法代码示例。如果您正苦于以下问题:Java MediaActionSound.play方法的具体用法?Java MediaActionSound.play怎么用?Java MediaActionSound.play使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.media.MediaActionSound
的用法示例。
在下文中一共展示了MediaActionSound.play方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: takeSnapshot
import android.media.MediaActionSound; //导入方法依赖的package包/类
private void takeSnapshot()
{
// get the snapshot image
Bitmap image = textureView.getBitmap();
// save the image
SimpleDateFormat sdf = new SimpleDateFormat("yyyy_MM_dd_hh_mm_ss");
String name = camera.network + "_" + camera.name.replaceAll("\\s+", "") + "_" + sdf.format(new Date()) + ".jpg";
Utils.saveImage(getActivity().getContentResolver(), image, name, null);
Log.info("takeSnapshot: " + name);
// play the shutter sound
MediaActionSound sound = new MediaActionSound();
sound.play(MediaActionSound.SHUTTER_CLICK);
// display a message
String msg = String.format(getString(R.string.image_saved), getString(R.string.app_name));
Toast toast = Toast.makeText(getActivity(), msg, Toast.LENGTH_SHORT);
toast.show();
}
示例2: playShutterSound
import android.media.MediaActionSound; //导入方法依赖的package包/类
private void playShutterSound() {
MediaActionSound sound = new MediaActionSound();
sound.play(MediaActionSound.SHUTTER_CLICK);
}
示例3: playFocusSound
import android.media.MediaActionSound; //导入方法依赖的package包/类
private void playFocusSound() {
MediaActionSound sound = new MediaActionSound();
sound.play(MediaActionSound.FOCUS_COMPLETE);
}
示例4: takePhoto
import android.media.MediaActionSound; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void takePhoto(MediaActionSound sound) {
//关闭声音
sound.play(MediaActionSound.SHUTTER_CLICK);
takePhoto();
}
示例5: startRecording
import android.media.MediaActionSound; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void startRecording(MediaActionSound sound) {
//关闭声音
sound.play(MediaActionSound.START_VIDEO_RECORDING);
startRecording();
}
示例6: stopRecording
import android.media.MediaActionSound; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void stopRecording(MediaActionSound sound) {
//关闭声音
sound.play(MediaActionSound.STOP_VIDEO_RECORDING);
stopRecording();
}
示例7: takePhoto
import android.media.MediaActionSound; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void takePhoto(MediaActionSound sound) {
sound.play(MediaActionSound.SHUTTER_CLICK);
takePhoto();
}
示例8: startRecording
import android.media.MediaActionSound; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void startRecording(MediaActionSound sound) {
sound.play(MediaActionSound.START_VIDEO_RECORDING);
startRecording();
}
示例9: stopRecording
import android.media.MediaActionSound; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void stopRecording(MediaActionSound sound) {
sound.play(MediaActionSound.STOP_VIDEO_RECORDING);
stopRecording();
}
示例10: playActionSoundAutofocusComplete
import android.media.MediaActionSound; //导入方法依赖的package包/类
public void playActionSoundAutofocusComplete() {
MediaActionSound player = getMediaActionSound();
if (player == null) return;
if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) return;
player.play(MediaActionSound.FOCUS_COMPLETE);
}
示例11: playActionSoundShutter
import android.media.MediaActionSound; //导入方法依赖的package包/类
public void playActionSoundShutter() {
MediaActionSound player = getMediaActionSound();
if (player == null) return;
if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) return;
player.play(MediaActionSound.SHUTTER_CLICK);
}
示例12: playShutterSound
import android.media.MediaActionSound; //导入方法依赖的package包/类
/**
* Play the camera shutter shound
*/
private void playShutterSound() {
MediaActionSound sound = new MediaActionSound();
sound.play(MediaActionSound.SHUTTER_CLICK);
}