Update 'sound'
30
sound.md
30
sound.md
@@ -1,2 +1,30 @@
|
|||||||
* [sound(freq,len)](sound)
|
# sound(freq,len)
|
||||||
|
Reprodueix un só a la freqüència `freq` durant `len` milisegons.
|
||||||
|
Si hi ha un só reproduïntse, s'ignora i se comença amb el nou só.
|
||||||
|
|
||||||
|
### Paràmetres
|
||||||
|
|
||||||
|
`freq`
|
||||||
|
Freqüència del só.
|
||||||
|
|
||||||
|
`len`
|
||||||
|
Duració del só en milisegons.
|
||||||
|
|
||||||
|
### Exemple
|
||||||
|
```
|
||||||
|
function init()
|
||||||
|
freq = 100
|
||||||
|
df = 10
|
||||||
|
end
|
||||||
|
|
||||||
|
function update()
|
||||||
|
freq = freq + df
|
||||||
|
if freq < 100 or freq >= 1000 then
|
||||||
|
df = -df;
|
||||||
|
freq = freq + df
|
||||||
|
end
|
||||||
|
sound(freq,100)
|
||||||
|
end
|
||||||
|
```
|
||||||
|
### Vore també
|
||||||
* [nosound()](nosound)
|
* [nosound()](nosound)
|
||||||
|
|||||||
Reference in New Issue
Block a user