game/godot

Godot3 API - Audio Streams

C/H 2018. 10. 27. 08:30

Audio Streams

Introduction

As you might have read already in the Audio Buses Tutorial , sound is sent to each bus via an AudioStreamPlayer.
오디오 버스 자습서에서 이미 읽었던 것처럼, 사운드는 AudioStreamPlayer를 통해 각 버스로 전송됩니다.

There are many types of AudioStreamPlayers which will be explained in detail. Each of it loads an AudioStream and plays it back.
AudioStreamPlayer에는 여러 가지 유형이 있으며 자세한 내용은 다음에서 설명합니다. 각각은 AudioStream을로드하고 재생합니다.

AudioStream

An audio stream is an abstract object that emits sound. It can come from many places, but most commonly from the filesystem. Audio files such as .wav or .ogg can be loaded as AudioStreams and placed inside an AudioStreamPlayer.
오디오 스트림은 사운드를 방출하는 추상 객체입니다. 그것은 많은 곳에서 올 수 있지만 가장 일반적으로 파일 시스템에서옵니다. .wav 또는 .ogg와 같은 오디오 파일은 AudioStreams로로드하여 AudioStreamPlayer 내부에 배치 할 수 있습니다.

When using these kind of files, you should choose which one is best for your specific use case:
이러한 종류의 파일을 사용하는 경우 특정 유스 케이스에 가장 적합한 파일을 선택해야합니다:

  • Audio files of type .wav are considerably big, but use little amount of your CPU to play. Hundreds of them can be played simultaneously with little impact to performance. This format is usually best for short sound effects, as the importer will trim them and convert them to IMA-ADPCM.
    .wav 유형의 오디오 파일은 상당히 크지 만 재생할 CPU의 양은 적습니다. 성능에 거의 영향을 미치지 않으면 서 수백 가지를 동시에 재생할 수 있습니다. 이 형식은 일반적으로 짧은 음향 효과에 가장 적합합니다. 임포터가이를 자르고 IMA-ADPCM으로 변환하기 때문입니다.
  • Audio files of type .ogg are much smaller, but use considerably more amount of CPU power to play back, so only a few can be played back (especially on mobile!). This format is usually best for music or long sound effect sequences. It also works well for voice at relatively low bitrates.
    .ogg 형식의 오디오 파일은 훨씬 작지만 재생할 CPU 전력이 훨씬 더 많으므로 몇 가지만 재생할 수 있습니다 (특히 모바일에서). 이 포맷은 일반적으로 음악이나 긴 사운드 효과 시퀀스에 가장 적합합니다. 또한 비교적 낮은 비트 전송률로 음성에도 잘 작동합니다.

Keep in mind both .wav and .ogg generally don’t contain looping information, so this information must be set on the import options of each:
wav와 .ogg은 일반적으로 반복 정보를 포함하지 않으므로이 정보는 각 정보의 가져 오기 옵션에서 설정해야합니다.

There are other types of AudioStreams, such as AudioStreamRandomPitch, which takes an existing AudioStream and modulates the pitch every time it’s played back randomly (great for some sound effects), and more will keep appearing in the future.
AudioStreamRandomPitch와 같은 다른 유형의 AudioStream도 있습니다. AudioStreamRandomPitch는 기존 AudioStream을 사용하고 무작위로 재생 될 때마다 음조를 변조하며 (일부 음향 효과에는 우수함) 향후 더 많은 음악이 계속 표시됩니다.

AudioStreamPlayer

This is the standard stream player, it can play to any given bus. In 5.1 sound, it can send to stereo mix or front speakers.
이것은 표준 스트림 플레이어입니다, 그것은 어떤 주어진 버스로 재생할 수 있습니다. 5.1 사운드에서는 스테레오 믹스 나 프론트 스피커로 보낼 수 있습니다.

AudioStreamPlayer2D

This is a variant of AudioStreamPlayer but emits sound in a 2D positional environment. When close to the left of the screen, the panning will go left. When close to the right side, it will go right.
이것은 AudioStreamPlayer의 변형이지만 2D 위치 환경에서 사운드를 방출합니다. 화면 왼쪽 가까이에 있으면 패닝이 왼쪽으로 이동합니다. 오른쪽 가까이에 가면 오른쪽으로 갈 것입니다.

While it’s possible to send these effects to specific audio buses, one of the best strategies is to use an Area2D to divert sound to a specific bus. This allows to create buses with different reverb or sound qualities and make the emitter will automatically send to them when entering the Area2D shapes.
이러한 효과를 특정 오디오 버스로 보낼 수는 있지만 가장 좋은 전략 중 하나는 Area2D를 사용하여 사운드를 특정 버스로 전환하는 것입니다. 이를 통해 다른 리버브 또는 음질의 버스를 만들 수 있고 이미 터가 Area2D 도형에 들어갈 때 자동으로 전송되도록 할 수 있습니다.

AudioStreamPlayer3D

This is a variant of AudioStreamPlayer but emits sound in a 3D positional environment. Depending on the location of the player relative of the screen, it can position sound in Stereo, 5.1 or 7.1 depending on the chosen audio setup.
이것은 AudioStreamPlayer의 변형이지만 3D 위치 환경에서 사운드를 방출합니다. 플레이어 상대의 위치에 따라 선택한 오디오 설정에 따라 스테레오, 5.1 또는 7.1로 사운드를 배치 할 수 있습니다.

Similar to AudioStreamPlayer2D, an Area can divert the sound to an audio bus.
AudioStreamPlayer2D와 마찬가지로, Area는 사운드를 오디오 버스로 전환시킬 수 있습니다.

Unlike for 2D, the 3D version of AudioStreamPlayer has a few more advanced options:
2D와 달리 AudioStreamPlayer의 3D 버전에는 몇 가지 고급 옵션이 있습니다:

Reverb Buses

Godot allows 3D Audio Streams that enter a specific Area to send dry and wet audio to separate buses. This is useful when you have several reverb configurations for different types of rooms. This is done by enabling this type of reverb in the Reverb Bus section of Area properties:
Godot은 특정 지역에 들어가는 3D 오디오 스트림이 건조하고 젖은 오디오를 별도의 버스로 보내도록 허용합니다. 여러 유형의 룸에 대해 여러 개의 리버브 구성을 사용하는 경우에 유용합니다. 이 작업은 Area 속성의 Reverb Bus 섹션에서 다음 유형의 리버브를 활성화하여 수행됩니다:

At the same time, a special bus layout is created where each area receives the reverb info from each area. Of course, an actual Reverb effect must be created in that bus for anything to happen:
동시에, 각 영역이 각 영역에서 리버브 정보를 수신하는 특수 버스 레이아웃이 만들어집니다. 물론, 버스에서 실제로 일어날 수있는 리버브 (Reverb) 효과가 만들어 져야합니다.

The Area Reverb Bus section has also a specific parameter named “Uniformity”. Some types of rooms bounce sounds more than others (like for example, a typical warehouse), so reverberation can be heard almost uniformly across the room even though the source is far away. Playing around with this parameter can simulate that effect.
Area Reverb Bus 섹션에는 "Uniformity"라는 특정 매개 변수도 있습니다. 일부 유형의 방은 다른 창보다 소리가 더 많이 나옵니다 (예 : 일반적인 창고와 같음). 소스가 멀리 있더라도 방 전체에서 잔향이 거의 균등하게 들립니다. 이 매개 변수로 재생하면 해당 효과를 시뮬레이션 할 수 있습니다.

Doppler

When the relative velocity between an emitter and listener changes, this is perceived as an increase or decrease of the pitch shift. Godot can track changes in velocities of AudioStreamPlayer3D or Camera. Both have this property, which must be enabled manually:
이미 터와 청취자 사이의 상대 속도가 변경되면 이는 피치 이동의 증가 또는 감소로 인식됩니다. Godot은 AudioStreamPlayer3D 또는 카메라의 속도 변화를 추적 할 수 있습니다. 이 속성은 모두 수동으로 활성화해야합니다.

Simply enable it by setting it depending on how objects will be moved (whether on regular process or physics_process step) and the tracking will happen automatically!
객체를 이동하는 방법 (일반 프로세스 또는 physics_process 단계)에 따라 설정하고 추적이 자동으로 수행되도록 설정하여 활성화하십시오.

반응형

'game > godot' 카테고리의 다른 글

Godot3 API - Mouse and input coordinates  (0) 2018.10.30
Godot3 API - InputEvent  (0) 2018.10.29
Godot3 API - Audio Buses  (0) 2018.10.26
Godot3 API - StaticBody2D  (0) 2018.10.25
Godot3 API - KinematicBody2D  (0) 2018.10.24