次の方法で共有


AudioManager.PlaySoundEffect Method

Definition

Overloads

PlaySoundEffect(SoundEffect)

Plays a sound effect (Key clicks, lid open/close.

PlaySoundEffect(SoundEffect, Single)

Plays a sound effect (Key clicks, lid open/close.

PlaySoundEffect(SoundEffect)

Plays a sound effect (Key clicks, lid open/close.

[Android.Runtime.Register("playSoundEffect", "(I)V", "GetPlaySoundEffect_IHandler")]
public virtual void PlaySoundEffect (Android.Media.SoundEffect effectType);
[<Android.Runtime.Register("playSoundEffect", "(I)V", "GetPlaySoundEffect_IHandler")>]
abstract member PlaySoundEffect : Android.Media.SoundEffect -> unit
override this.PlaySoundEffect : Android.Media.SoundEffect -> unit

Parameters

effectType
SoundEffect

The type of sound effect. NOTE: This version uses the UI settings to determine whether sounds are heard or not.

Attributes

Remarks

Plays a sound effect (Key clicks, lid open/close...)

Java documentation for android.media.AudioManager.playSoundEffect(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

PlaySoundEffect(SoundEffect, Single)

Plays a sound effect (Key clicks, lid open/close.

[Android.Runtime.Register("playSoundEffect", "(IF)V", "GetPlaySoundEffect_IFHandler")]
public virtual void PlaySoundEffect (Android.Media.SoundEffect effectType, float volume);
[<Android.Runtime.Register("playSoundEffect", "(IF)V", "GetPlaySoundEffect_IFHandler")>]
abstract member PlaySoundEffect : Android.Media.SoundEffect * single -> unit
override this.PlaySoundEffect : Android.Media.SoundEffect * single -> unit

Parameters

effectType
SoundEffect

The type of sound effect.

volume
Single

Sound effect volume. The volume value is a raw scalar so UI controls should be scaled logarithmically. If a volume of -1 is specified, the AudioManager.STREAM_MUSIC stream volume minus 3dB will be used. NOTE: This version is for applications that have their own settings panel for enabling and controlling volume.

Attributes

Remarks

Plays a sound effect (Key clicks, lid open/close...)

Java documentation for android.media.AudioManager.playSoundEffect(int, float).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to