I. Basic information
1. Supported Sound formats
WAV OGG MP3 AIFF MOD s3m xm IT after importing, unity will choose the compression method:WAV: Lossless, good sound, large file, suitable for shorter filesOGG,MP3: lossy, file small, suitable for longer files, such as game background music
2. Compression format (Compression Forma
) drag into Audio-view panel: 1/PCM: is WAV format2/vorbis: Is the OGG format3/ADPCM: Compresses the PCM16 compression sample to 4 bits4/mp3: When packaged as a mobile end
3. Load type (load types)1/decompress on Load: Extract files After program load, reduce run-time performance overhead, high memory consumption2/compressed in memory: Compress the file when playing in the RAM, small memory, suitable for long music3/streaming: Stream, directly read audio data from disk, occupy more memory than the original file is much smaller, suitable for playing long music, such as background music
4. Data Setup (Sample rate Setting)1/preserve Sample rate: Raw default sampled data (Common)2/optimize Sample Rate: Optimized data3/override Sample Rate: Custom Data
5. Otherforce to Mono: forced Monoload in Background: Background loadingpreload audio Data: Pre-fabricated sound files
6. Audio Manager AudiomanagerEdit-project Settings-audio Global Volume: Overall volume-1 maxVolume rolloff Scale: Volume attenuation (for 3D sound)-The higher the value, the faster the volume attenuation-the real-world effect at 1Doppler Factor: Doppler effect (for mobile sound)default Speaker mode: defaults to Speaker modeDSP buffer size:dsp Cache area size (general default)
Ii. Audio Listener and audio Source
1.Audio SourceMute Mute: tick to play but can't hearBypass effects Pass-through sound: all sound in the switch sceneBypass Listener Effect: Audio switch for listenersBypass Reverb Zone: Audio switch for mixed areasplay on awake: Play when the program is runningLoop : LoopingPriority : Playback level, default 128, the higher the number, the lower the number, the higher the sizeVolume: VolumePitch: Change the speed of the sound to change the speed of the tone, the faster the tone, the higherStereo Pan: ChannelSpatial blend:2d, 3D mixing amountReverb Zone Mix: Mix amount of confusing areas
3D Sound Settings:Doppler Lever: Doppler level (when objects move at high speed to see the effect)Spread: Propagation AngleVolume rolloff Volume attenuation type:logarithmic rolloff: logarithmic typeLinear rolloff: LinetypeCustom rolloff: CustomizingMin Max Distance: min Max distance
using UnityEngine;
using System.Collections;
publicclassAudioController:MonoBehaviour{
privateAudioSource myAudio;
voidStart(){
myAudio =this.GetComponent<AudioSource>();
}
voidOnGUI()
{
if(GUILayout.Button("play"))
{
if(!myAudio.isPlaying)
{
myAudio.Play();
}
}
if(GUILayout.Button("stop"))
{
if(myAudio.isPlaying)
{
myAudio.Stop();
}
}
}
}
third, audio mixer mixer--audio The output property of the source component requires a mixer (to add effects to the sound)if set, the process of receiving the sound becomes: Audio source output to audio mixer-then to listener (mixer can be overlapped)
From for notes (Wiz)
U3D Audio System