Source (Tiếng Việt)

Đối tượng Source biểu diễn cho âm thanh mà bạn có thể phát lại. Với Source, bạn có thể làm nhiều việc hay, chẳng hạn đặt âm lượng, độ cao, và cả vị trí nguồn âm so với người nghe.

Source điều khiển các thao tác (phát/ngừng/v.v.) tùy theo bảng trạng thái sau.

Đã kết thúc Đang phát Tạm dừng
play() Phát Không đổi Phát
stop() Không đổi Kết thúc + Về lại đầu Kết thúc + Về lại đầu
pause() Không đổi Tạm dừng Không đổi
resume() Không đổi Không đổi Phát
rewind() Về lại đầu Về lại đầu + Phát Về lại đầu + Tạm dừng

Và với những bạn ưa thích lưu đồ (lưu ý: những lời gọi bỏ qua thì không có tác dụng gì, nhưng việc trở lại đầu thì có).

SourceControls.png

Constructor

love.audio.newQueueableSourceCreates a new Source usable for real-time generated sound playback with Source:queue.
love.audio.newSourceCreates a new Source from a file, SoundData, or Decoder.

Hàm

Object:releaseImmediately destroys the object's Lua reference.
Object:typeGets the type of the object as a string.
Object:typeOfChecks whether an object is of a certain type.
Source:cloneCreates an identical copy of the Source in the stopped state.
Source:getActiveEffectsGets a list of the Source's active effect names.
Source:getAirAbsorptionGets the amount of air absorption applied to the Source.
Source:getAttenuationDistancesGets the reference and maximum attenuation distances of the Source.
Source:getChannelCountGets the number of channels in the Source.
Source:getChannelsGets the number of channels in the Source.
Source:getConeGets the Source's directional volume cones.
Source:getDirectionGets the direction of the Source.
Source:getDistanceReturns the reference and maximum distance of the source.
Source:getDurationGets the duration of the Source.
Source:getEffectRetrieve filter settings associated to a specific effect.
Source:getFilterGets the filter settings currently applied to the Source.
Source:getFreeBufferCountGets the number of free buffer slots of a queueable Source.
Source:getPitchGets the current pitch of the Source.
Source:getPositionGets the position of the Source.
Source:getRolloffReturns the rolloff factor of the source.
Source:getTypeGets the type of the Source.
Source:getVelocityGets the velocity of the Source.
Source:getVolumeGets the current volume of the Source.
Source:getVolumeLimitsReturns the volume limits of the source.
Source:isLoopingReturns whether the Source will loop.
Source:isPausedReturns whether the Source is paused.
Source:isPlayingReturns whether the Source is playing.
Source:isRelativeGets whether the Source's position and direction are relative to the listener.
Source:isStaticReturns whether the Source is static.
Source:isStoppedReturns whether the Source is stopped.
Source:pausePauses a source.
Source:playPlays a source.
Source:queueQueues SoundData for playback in a queueable Source.
Source:resumeResumes a paused source.
Source:rewindRewinds a source.
Source:seekSets the currently playing position of the Source.
Source:setAirAbsorptionSets the amount of air absorption applied to the Source.
Source:setAttenuationDistancesSets the reference and maximum attenuation distances of the Source.
Source:setConeSets the Source's directional volume cones.
Source:setDirectionSets the direction of the Source.
Source:setDistanceSets the reference and maximum distance of the source.
Source:setEffectApplies an audio effect to the Source.
Source:setFilterSets a low-pass, high-pass, or band-pass filter to apply when playing the Source.
Source:setLoopingSets whether the Source should loop.
Source:setPitchSets the pitch of the Source.
Source:setPositionSets the position of the Source.
Source:setRelativeSets whether the Source's position and direction are relative to the listener.
Source:setRolloffSets the rolloff factor.
Source:setVelocitySets the velocity of the Source.
Source:setVolumeSets the current volume of the Source.
Source:setVolumeLimitsSets the volume limits of the source.
... further results

Kiểu cấp trên

Object

Xem thêm


Ngôn ngữ khác