HU/getSoundWaveData: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 7: | Line 7: | ||
Ha az elem egy játékos, akkor ez a funkció a játékos hangját fogja használni | Ha az elem egy játékos, akkor ez a funkció a játékos hangját fogja használni | ||
}} | }} | ||
== | ==Szintaxis== | ||
<syntaxhighlight lang="lua">table getSoundWaveData ( element sound, int iSamples )</syntaxhighlight> | <syntaxhighlight lang="lua">table getSoundWaveData ( element sound, int iSamples )</syntaxhighlight> | ||
{{OOP||[[sound]]:getWaveData}} | {{OOP||[[sound]]:getWaveData}} | ||
=== | ===Kötelező Argumentumok=== | ||
*'''sound:''' a [[sound]] [[element]] that is created using [[playSound]] or [[playSound3D]]. Streams are also supported | *'''sound:''' a [[sound]] [[element]] that is created using [[playSound]] or [[playSound3D]]. Streams are also supported | ||
*'''iSamples:''' allowed samples are 256, 512, 1024, 2048, 4096, 8192 and 16384. | *'''iSamples:''' allowed samples are 256, 512, 1024, 2048, 4096, 8192 and 16384. | ||
=== | ===Visszaadott érték=== | ||
Returns a [[table]] of '''iSamples''' ''floats'' representing the current audio frame waveform. | Returns a [[table]] of '''iSamples''' ''floats'' representing the current audio frame waveform. | ||
Returns ''false'' if the sound is not playing yet or hasn't buffered in the | Returns ''false'' if the sound is not playing yet or hasn't buffered in the | ||
case of streams. | case of streams. | ||
== | ==Példa== | ||
<section name="Client" class="client" show="true"> | <section name="Client" class="client" show="true"> | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
Line 42: | Line 42: | ||
{{ChangelogItem|1.3.2|Added player element to use a players voice}} | {{ChangelogItem|1.3.2|Added player element to use a players voice}} | ||
== | ==Lásd még== | ||
{{Client_audio_functions hu}} | {{Client_audio_functions hu}} | ||
[[en:getSoundWaveData]] | [[en:getSoundWaveData]] | ||
[[ar:getSoundWaveData]] | [[ar:getSoundWaveData]] | ||
==Fordította== | |||
Surge |
Revision as of 13:03, 19 July 2018
Ez a funkció megkapja a hullámformátum adatait egy hangfolyamhoz, amely a float egyik táblája, ami az aktuális audiokeretet hullámként ábrázolja. Ez lehetővé teszi például a vizualizálást.
Ha az elem egy játékos, akkor ez a funkció a játékos hangját fogja használni
Szintaxis
table getSoundWaveData ( element sound, int iSamples )
OOP Syntax Help! I don't understand this!
- Method: sound:getWaveData(...)
Kötelező Argumentumok
- sound: a sound element that is created using playSound or playSound3D. Streams are also supported
- iSamples: allowed samples are 256, 512, 1024, 2048, 4096, 8192 and 16384.
Visszaadott érték
Returns a table of iSamples floats representing the current audio frame waveform. Returns false if the sound is not playing yet or hasn't buffered in the case of streams.
Példa
Click to collapse [-]
ClientsoundHandler = playSound ( "sound.wav" ) function onSoundPlayRender ( ) if ( soundHandler ) then local waveData = getSoundWaveData ( soundHandler, 256 ) if ( waveData ) then for i=0,255 do dxDrawRectangle ( i, 128, 1, waveData[i] * 128) end end end end addEventHandler ( "onClientRender", getRootElement(), onSoundPlayRender )
Changelog
Version | Description |
---|
1.3.2 | Added player element to use a players voice |
Lásd még
- HU/getRadioChannel
- HU/getRadioChannelName
- HU/getSFXStatus
- HU/getSoundBPM
- HU/getSoundEffects
- HU/getSoundFFTData
- HU/getSoundLength
- HU/getSoundLevelData
- HU/getSoundMaxDistance
- HU/getSoundMetaTags
- HU/getSoundMinDistance
- HU/getSoundPan
- HU/getSoundPosition
- HU/getSoundProperties
- HU/getSoundSpeed
- HU/getSoundVolume
- HU/getSoundWaveData
- HU/isSoundPanningEnabled
- HU/isSoundPaused
- HU/playSFX
- HU/playSFX3D
- HU/playSound
- HU/playSound3D
- HU/playSoundFrontEnd
- HU/setRadioChannel
- HU/setSoundEffectEnabled
- HU/setSoundMaxDistance
- HU/setSoundMinDistance
- HU/setSoundPan
- HU/setSoundPanningEnabled
- HU/setSoundPaused
- HU/setSoundPosition
- HU/setSoundProperties
- HU/setSoundSpeed
- HU/setSoundVolume
- HU/stopSound
Fordította
Surge