love.audio.newSource (한국어)
파일, 디코더, SoundData로부터 새로운 오디오 소스를 생성합니다. SoundData를 통해 만들어진 오디오 소스는 정적으로 생성됩니다.
![]() |
This function can be slow if it is called repeatedly, such as from love.update or love.draw. If you need to use a specific resource often, create it once and store it somewhere it can be reused! |
Contents
함수
형식
source = love.audio.newSource( filename, type )
매개변수
string (한국어) filename
- The filepath to the audio file.
SourceType (한국어) type ("stream")
- Streaming or static source.
Returns
Source (한국어) source
- A new Source that can play the specified audio.
Function
Synopsis
source = love.audio.newSource( file, type )
Arguments
File (한국어) file
- A File pointing to an audio file.
SourceType (한국어) type ("stream")
- Streaming or static source.
Returns
Source (한국어) source
- A new Source that can play the specified audio.
Function
Synopsis
source = love.audio.newSource( decoder, type )
Arguments
Decoder (한국어) decoder
- The Decoder to create a Source from.
SourceType (한국어) type ("stream")
- Streaming or static source.
Returns
Source (한국어) source
- A new Source that can play the specified audio.
Function
Synopsis
source = love.audio.newSource( data )
Arguments
SoundData (한국어) data
- The SoundData to create a Source from.
Returns
Source (한국어) source
- A new Source that can play the specified audio. The SourceType of the returned audio is "static".
Examples
Load background music and play it
bgm = love.audio.newSource("bgm.ogg", "stream")
love.audio.play(bgm)
효과음을 불러와 재생하기
sfx = love.audio.newSource("sfx.wav", "static")
love.audio.play(sfx)
SoundData로 새 오디오 소스 만들기
data = love.sound.newSoundData("sfx.wav")
sfx = love.audio.newSource(data)
디코더로 새 오디오 소스 만들기
decoder = love.sound.newDecoder("bgm.ogg")
bgm = love.audio.newSource(decoder)
같이 보기
다른 언어
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info