How to play native camera sound on Android

后端 未结 6 1965
星月不相逢
星月不相逢 2020-12-29 21:29

I would like to play native camera shutter sound clip on camera preview capture. I\'m referring to the sound clip played when takePicture() is called.
How

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-29 21:55

    You can use the MediaActionSound class (available from API 16). For example:

    MediaActionSound sound = new MediaActionSound();
    sound.play(MediaActionSound.SHUTTER_CLICK);
    

提交回复
热议问题