AudioClip audio clip

* AudioClip
* audio clip ( Audio clip ).
* We import to Unity All sound files in , stay Unity The resource types in the engine are all  AudioClip type .
* Unity Available audio formats : .aif   .wav   .mp3   .ogg
* stay Project Panel's Assets Create a “Audios” Folder to store and manage audio resources used in the game .
AudioSource assembly

* Introduction to components
* AudioSource: Audio source components , For playing audio clips (AudioClip) resources .
* establish  AudioSource
* Create a new empty object ;
* Add to the empty object  AudioSource assembly .Component --> Audio --> AudioSource
* AudioSource Common properties
* AudioClip( audio clip )
* Specify which audio file this audio source plays .
* Play On Awake( Start playback on wake up )
* After checking , After the game runs , It will start playing .
* Loop( loop )
* After checking , Voice in “ Single tune circulation ” state .
* Mute( Mute )
* After checking , Mute , But the audio is still playing .
* Volume( volume )
* 0: No sound ;1: Volume Max .
* Spatial Blend( Spatial mixing )
* Set sound to be 2D voice , still 3D voice .
* 2D There is no spatial change in sound ,3D There is a spatial change in sound , The closer to the source, the more obvious .
* Audio Listener assembly
* Audio Listener: Sound listener , In the game world “ Ears ”.
* We rely on this component to listen to the sound in the game , Without this component , We can't hear anything .
* By default, this component is attached to the camera .
* Audio Source Common functions
* Play() function
* Play audio clip .
* Stop() function
* stop playing .
* Pause() function
* Pause playback . public class AudioController : MonoBehaviour { private AudioSource
m_AudioSource; void Start () { m_AudioSource =
gameObject.GetComponent<AudioSource>(); } void Update () {
if(Input.GetKeyDown(KeyCode.A)) { m_AudioSource.Play (); } if
(Input.GetKeyDown(KeyCode.S)) { m_AudioSource.Stop (); } if
(Input.GetKeyDown(KeyCode.D)) { m_AudioSource.Pause (); } } }
 

 

 

Technology
©2019-2020 Toolsou All rights reserved,
Share has surpassed Ningde Era !LG Chemical confirmation to spin off battery business unit uboot set up nfs parameter ——linux kernel use nfs Mode to load the root file system rootfs( Six ) Summary of artificial intelligence algorithm git Pull the remote branch and switch to it Fiddler Simulate request sending and modifying response data Note 14 : The second biggest obstacle to motivating others in R & D management SSM Project's excel File upload and add to database airflow Question series 2 —— task keep running Suspended animation Spark SQL- programming tfrecord How to use the format