当前位置: 首页>>代码示例>>Java>>正文


Java MediaActionSound.play方法代码示例

本文整理汇总了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();
}
 
开发者ID:ShawnBaker,项目名称:RPiCameraViewer,代码行数:21,代码来源:VideoFragment.java

示例2: playShutterSound

import android.media.MediaActionSound; //导入方法依赖的package包/类
private void playShutterSound() {
    MediaActionSound sound = new MediaActionSound();
    sound.play(MediaActionSound.SHUTTER_CLICK);
}
 
开发者ID:akexorcist,项目名称:CameraSample,代码行数:5,代码来源:CameraV1Activity.java

示例3: playFocusSound

import android.media.MediaActionSound; //导入方法依赖的package包/类
private void playFocusSound() {
    MediaActionSound sound = new MediaActionSound();
    sound.play(MediaActionSound.FOCUS_COMPLETE);
}
 
开发者ID:akexorcist,项目名称:CameraSample,代码行数:5,代码来源:CameraV1Activity.java

示例4: takePhoto

import android.media.MediaActionSound; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void takePhoto(MediaActionSound sound) {
    //关闭声音
    sound.play(MediaActionSound.SHUTTER_CLICK);
    takePhoto();
}
 
开发者ID:MartinRGB,项目名称:android_camera_experiment,代码行数:7,代码来源:RecordButton.java

示例5: startRecording

import android.media.MediaActionSound; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void startRecording(MediaActionSound sound) {
    //关闭声音
    sound.play(MediaActionSound.START_VIDEO_RECORDING);
    startRecording();
}
 
开发者ID:MartinRGB,项目名称:android_camera_experiment,代码行数:7,代码来源:RecordButton.java

示例6: stopRecording

import android.media.MediaActionSound; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void stopRecording(MediaActionSound sound) {
    //关闭声音
    sound.play(MediaActionSound.STOP_VIDEO_RECORDING);
    stopRecording();
}
 
开发者ID:MartinRGB,项目名称:android_camera_experiment,代码行数:7,代码来源:RecordButton.java

示例7: takePhoto

import android.media.MediaActionSound; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void takePhoto(MediaActionSound sound) {
    sound.play(MediaActionSound.SHUTTER_CLICK);
    takePhoto();
}
 
开发者ID:sandrios,项目名称:sandriosCamera,代码行数:6,代码来源:RecordButton.java

示例8: startRecording

import android.media.MediaActionSound; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void startRecording(MediaActionSound sound) {
    sound.play(MediaActionSound.START_VIDEO_RECORDING);
    startRecording();
}
 
开发者ID:sandrios,项目名称:sandriosCamera,代码行数:6,代码来源:RecordButton.java

示例9: stopRecording

import android.media.MediaActionSound; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void stopRecording(MediaActionSound sound) {
    sound.play(MediaActionSound.STOP_VIDEO_RECORDING);
    stopRecording();
}
 
开发者ID:sandrios,项目名称:sandriosCamera,代码行数:6,代码来源:RecordButton.java

示例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);
}
 
开发者ID:kloener,项目名称:visor-android,代码行数:7,代码来源:VisorSurface.java

示例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);
}
 
开发者ID:kloener,项目名称:visor-android,代码行数:7,代码来源:VisorSurface.java

示例12: playShutterSound

import android.media.MediaActionSound; //导入方法依赖的package包/类
/**
 * Play the camera shutter shound
 */
private void playShutterSound() {
    MediaActionSound sound = new MediaActionSound();
    sound.play(MediaActionSound.SHUTTER_CLICK);
}
 
开发者ID:vector-im,项目名称:riot-android,代码行数:8,代码来源:VectorMediasPickerActivity.java


注:本文中的android.media.MediaActionSound.play方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。