找回密码
 注册帐号

扫一扫,访问微社区

其他 音频文件 Audio Files

0
回复
1644
查看
[ 复制链接 ]
4四处流浪
331/500
排名
13985
昨日变化

56

主题

99

帖子

331

积分

Rank: 4

UID
5
好友
1
蛮牛币
1110
威望
0
注册时间
2013-5-24
在线时间
66 小时
最后登录
2020-11-12
2014-8-22 09:30:00 显示全部楼层 阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?注册帐号

x
Just like when using Meshes or Textures, the workflow for Audio File   assets is designed to make things work for you quickly and easily.  You   can make your Audio Files with any format you like, and Unity can   import them and play them back, but there's some specific information   you should know for working with Audio Files.
就像在使用网格或纹理一样,音频文件资源的工作流程是目的是使你快速而简单的工作。你可以使用你喜欢的任何音频文件格式,Unity可以导入他们并播放,但有一些音频文件工作的具体信息你应该知道。
Audio in Unity is either Native or Compressed.  Unity support the most common formats (see list after this). Just drag the file into the Editor to import the file. The default mode is Native and Unity just uses the original file. Unity can also compress the supplied file. Choose the Compressed option in the importer. (Unity IPhone can make use of the hardware   decoder. See IPhone specific documentation for this). The difference   between Native and Compressed is outlined here:
Unity的音频文件可以是原生的或未压缩的。Unity支持大多数的格式(参见下面的列表)。只需拖拽这个文件到编辑器中来导入文件。默认的模式是Native(原生的)Unity使用原始文件。Unity也可以压缩文件。在导入器选择Compressed压缩选项。(Unity iPhone可以使用硬件解码,见文档iPhone部分)。这里列出的原生的(Native)和压缩的(Compressed)之间的区别是:
  • Compressed: Compress sounds by choosing the compressed option from inside the Editor. The audio data will be small, but will   cost CPU cycles to decode at play time. Depending on the target, Unity   will encode the audio to either Ogg Vorbis(Mac/PC/Consoles) or MP3   (Mobile platforms). For the best sound quality supply the audio in an   uncompressed format such as WAV or AIFF (containing PCM data) and let   Unity do the encoding. If only targeting Mac/PC (standalones,   webplayers) importing an Ogg Vorbis file will not degrade the quality.   But converting to mobile platforms will force a re-encode to MP3 and   cause a slight quality degradation. Same goes for importing MP3, when   only targeting mobile platforms.
    压缩的:压缩声音是通过从编辑器导入设置选择compressed选项,在音频数据将很小,但在播放时会消耗CPU周期来解码。取决于目标,Unity将编码音频到Ogg Vorbis(Mac/PC/Consoles) 或 MP3 (Mobile platforms)格式,为获得最佳声音质量,提供了未压缩的音频格式,像such as WAV or AIFF (containing PCM data)并让Unity编码。如果目标只是Mac/PC (standalones, webplayers) 导入Ogg Vorbis文件不会降低质量。但转换到移动平台将强制重编码到MP3,会导致轻微的质量下降,当目标只是移动平台时,导入MP3也是一样。
  • Native: Use Native (WAV, AIFF)   audio for short sound effects. The audio data will be larger, but   sounds won't need to be decoded at play time.
    原生的:对于短音效使用未压缩音频(WAV, AIFF)。音频数据将较大,但声音在播放时并不需要解码。
Any Audio File imported into Unity is an Audio Clip. Audio Clips work in conjunction with Audio Sources and an Audio Listener.    Think of Clips as audio data only.  When you attach your Clip to an   object in the game, it becomes an Audio Source and it now has Volume, Pitch,   and a wealth of other properties.  While a Source is playing, an Audio   Listener can "hear" all Sources that are close enough, and those are the   sounds you will hear through your speakers.  There can be only one   Audio Listener in your scene, and this is usually attached to the Main Camera.  In most cases you will work with Audio Sources more than Clips or Listeners.
任何被导入到Unity中的音频文件都被称为Audio Clip(音频剪辑)。音频剪辑工作是与音频源和音频侦听器结合使用,只将剪辑作为音频数据。当你在游戏中将剪辑添加到一个物件上,它会变成一个音频源,它现在有音量,音调,和像循环这样的其他属性。虽然一个源播放时,一个音频监听器可以"听到"所有距离够近的源,那些是你通过扬声器会听到的声音。在你的场景中只能有一个音频监听器,它一般是添加在主摄像头上的。在大多数情况下,你对于音频源进行操作,将多于剪辑和监听器。
Supported Formats 支持的格式
FormatCompressed as (Mac/PC)Compressed as (Mobile)
MPEG(1/2/3)
Ogg Vorbis
MP3
Ogg Vorbis
Ogg Vorbis
MP3
WAV
Ogg Vorbis
MP3
AIFF
Ogg Vorbis
MP3
MOD
-
-
IT
-
-
S3M
-
-
XM
-
-
See the Sound chapter in the Creating Gameplay section of this manual for more information on using sound in Unity.
在Unity中使用声音的更多信息,查看Creating Gameplay中的Sound部分。
Audio Clip 音频剪辑Audio Clips are audio data used by Audio Sources.    Unity supports mono, stereo and multi (up to 8) channels audio assets.   Unity supports importing the following audio file formats: .aif, .wav, .mp3, and .ogg, and the following tracker module file formats: .xm, .mod, .it, and .s3m.   The tracker module assets works the same way as any other audio assets   in Unity except no waveform preview can be rendered to the asset import   inspector.
音频剪辑被音源所使用来表现被导入到Unity的音频资产。Unity同时支持单声道和立体声音频资产。Unity支持导入以下音频文件格式:.aif, .wav, .mp3, 和 .ogg,和以下音轨模块:.xm, .mod, .it, 和 .s3m。在Unity音轨模块资源和其他音频资源一样,除了无波形预览渲染到资源导入检视面板。
Audio%20Files-0.jpg
The Audio Clip Inspector 音频剪辑检视面板
Properties 属性
  •             Audio Format 音频格式
                The specific format that will be used for the sound at runtime.
    在运行时被应用到声音上的特定格式。
  •                 Native 原生的
                Larger file size, higher quality. Best for very short sound effects.
    较大文件尺寸,较高质量。最适用于很短的音效。
  •                 Compressed 压缩的
                Smaller file size, lower/variable quality. Best for medium length sound effects and music.
    较小文件尺寸,较低/不稳定质量。最适用于中等长度音效与音乐。
  •             3D Sound 三维声音
                If enabled, the sound will play back in 3D space. Both Mono and Stereo sounds can be played in 3D.
    如果启用,音乐将在3D空间中播放。在Unity2.6中,单声道和立体声都可以在3D中播放。
  •             Force to mono 强制单声道
                If enabled, the audio clip will be down-mixed to a single channel sound.
    如果启用,该音频剪辑将向下混合到单通道声音。
  •             Load Type 加载类型
                The way Unity load audio assets runtime.
                       运行时Unity加载音频的方法。
  •                 Decompress on load
                           加载时解压缩
                Decompress sounds upon load. Use this for smaller compressed sounds to avoid the performance overhead of decompressing on the fly. Beware that decompressing sounds on load will use ~10x more memory than keeping them compressed in memory, so don't use this for large files.
                       加载后解压缩声音。使用于较小的压缩声音,以避免运行时解压缩的性能开销。要注意加载时解压缩声音将使用比在它们在内存中压缩的多10倍或更多内存,因此不要使用这个到大文件。
  •     Compressed in memory
        在内存中压缩
                Keep sounds compressed in memory and decompress while playing. This have a slight performance overhead (esp. for Ogg/Vorbis compressed files) so only use this for bigger files.
                       保持声音在内存中是压缩的并在播放时解压缩。这有轻微的性能开销(尤其是OGG / Vorbis格式的压缩文件),因此使用这个为大文件。
  •     Stream from disc
        从磁盘流
                Stream audio data directly from disc. This uses a fraction of the original sounds size of memory. Use this for your music or very long tracks. Depending on the hardware, a general advice is to keep this down to 1-2 simultaneously streams.
                       直接从磁盘流音频数据。这只使用了原始声音占内存大小的很小一部分。使用这个用于很长的音乐。取决于硬件,一般建议1-2线程同时流。
  •             Compression
    压缩
                Amount of Compression to be applied to a Compressed clip. Statistics about file size can be seen beneath the slider. It is suggested to drag the slider to a place that leaves the playback "good enough" but still at a small enough size to meet your file size/distribution needs.
                       压缩量应用于压缩的剪辑。有关文件大小的统计可以在之后的滑动条看到。可以拖动滑条来调整来调整大小,播放声音来判断音质,但保持在一个足够小的尺寸,以满足您的文件大小/分配需要。
  •             Hardware Decoding
    硬件解码
                (iOS ONLY) Available for compressed audio on iOS devices. Uses Apple's hardware decoder for less CPU intensive decompression. Check out Platform Specific details for more info.
                       (仅iOS)用于iOS设备压缩的音频。使用苹果的硬件解码来减少CPU的密集解压缩。
  • Gapless looping
    无缝循环
                (/iOS ONLY) Use this when compressing a perfect looping audio source file (in a non-compressed PCM format) to preserve the loop. Standard MPEG encoders introduce silence around the loop point, which will play as little "click" or "pop". Unity handles this smoothly for you.
                       (仅Android/iOS)当压缩一个完美的循环音频源文件(在一个非压缩的PCM格式)保持循环时,使用这个。标准的MPEG编码器插入silence循环点,播放时有小的"click" 或 "pop"(可能是短暂停顿的意思)。Unity为你顺畅处理这个问题
Importing Audio Assets 导入音频资源Unity supports both Compressed and Native Audio.  Any type of file (except MP3/Ogg Vorbis) will be initially imported as Native. Compressed audio files must be decompressed by the CPU while the game is running, but are smaller in file size. If Stream is checked the audio is decompressed on the fly,   or else the audio is decompressed entirely upon load. Native PCM   formats (WAV, AIFF) have the benefit of being higher fidelity without   increasing CPU taxation, but create much larger files. Module files   (.mod,.it,.s3m..xm) can deliver very high quality with an extremely low   footprint.
Unity支持压缩的和原生的音频。任何类型的文件(MP3/Ogg Vorbis的除外),最初都以原生音频导入(Native即不经任何处理的音频本身)。游戏运行时,压缩音频文件必须由CPU解压缩,但文件要较小。流(Stream )被选择,音频在将运行时解压缩,或者音频在加载时完全解缩。原生PCM格式(WAV,AIFF)有在不增加CPU资源同时有更高的保真度的好处,但创建更大的文件。模块文件(.MOD,.S3M,. XM)可以提供非常高的质量与极低的占用空间。
As a general rule of thumb, Compressed audio(or modules) are best for long files like background music or   dialog, and uncompressed is better for short sound effects. Tweak the   amount of Compression with the compression slider to just before the   difference in sound quality is noticeable.
一般的经验是,压缩音频(或模块)最好是长文件,如背景音乐或对话,未压缩的用于短声音效果更好。用压缩滑动条(Compression)来调整压缩量,前后音质的差异是明显的。

Using 3D Audio 使用3D音频If an audio clip is marked as a 3D Sound   then it will be played back to simulate its position in the game   world's 3D space. 3D sounds emulate distance and location of sounds by   attenuating volume and panning across speakers. Both mono and multiple   channel sounds can be positioned in 3D. For multiple channel audio, use   the spread option on the Audio Source to spread and split out the discrete channels in speaker space. Unity   offers a variety of options to control and fine-tune the audio behavior   in 3D space. Take a look at Audio Source.
如果音频剪辑标记为3D声音(3D Sound),它会模拟在游戏世界三维空间中的位置播放。 3D声音以衰减音量和扬声器之间平衡调整模拟声音的距离和位置。单声道和​​多声道声音都可以放置在三维空间。对于多声道音频,使用的音频源(Audio Source)中的扩散(spread )选项来扩散并在扬声器空间分离出离散通道。Unity提供了多个选项,来控制和微调三维空间中音频的行为。参见音频源(Audio Source)。
Platform specific details 平台支持细节iOS
On mobile platforms compressed audio is encoded as MP3 for less CPU intensive decompression.
在移动平台上的压缩音频以MP3格式编码,以在解压缩时占用更少的CPU资源。
For performance reasons audio clips can be played back   using the Apple hardware codec. To enable this check the "Hardware   Decoding" checkbox in the Audio Importer.   Note that only one hardware audio stream can be decompressed at a time,   including the background iPod audio.
出于性能方面的原因音频剪辑可以使用苹果的硬件编解码器进行播放。要启用它,在音频导入器(Audio Importer)下的"硬件解码(Hardware Decoding)"复选框勾选上。请注意,同一时间只能有一个硬件音频流解压缩,包括背景的iPod音频。
If the hardware decoder is not available, the   decompression will fall back on the software decoder (on iPhone 3GS or   newer Apple's software decoder is used over Unity's(FMOD) own decoder).
如果硬件解码器不可用,解压的任务将落在软件解码器上(iPhone 3GS或更新的苹果软件解码器是使用Unity(FMOD)自带的解码器)。

Android
On mobile platforms compressed audio is encoded as MP3 for less CPU intensive decompression.
在移动平台上的压缩音频以MP3格式编码,以在解压缩时占用更少的CPU资源。



background music unity;unity 预加载资源;unity加背景音乐;play audio unity;unity 音乐重新播放;unity camera target;unity中split;unity让背景循环移动;unity look at;unity与source比较;unity 预加载场景;camera clip unity;unity 5 sound;unity (original);unity fmod;unity inspector list;unity docum;unity background music;unity 资源预加载;unity 背景音乐;unity 5 play audio;unity播放本地音乐;unity音乐播放;unity 播放音乐;unity target camera;unity split;unity 背景循环;unity 循环背景;look at unity;unity source;unity 场景预加载;unity camera clip;unity sound;unity original;unity 使用fmod;fmod unity 5;unity list inspector;unity 5 documentation;用unity如何播放音频;unity音频播放;unity 5 software;unity 5 audio source;unity multi scene;unity no android module;音乐unity mp3;unity如何预渲染
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册帐号

本版积分规则