Sine wave: Difference between revisions

483 bytes added ,  2 years ago
m (→‎{{header|Phix}}: syntax coloured, marked p2js incompatible)
Line 422:
var buffer = sineWave.call(440, 5, sampleRate)
Wav.create("sinewave.wav", buffer, sampleRate)</lang>
 
=={{header|Yabasic}}==
<lang Yabasic>// Rosetta Code problem: http://rosettacode.org/wiki/Sine_wave
// by Galileo, 05/2022
 
sub MyBeep(frequency, duration)
local n
if duration = 0 duration = 5000
if peek$("os") = "unix" then
system("play -n synth " + str$(duration/1000) + " sine " + str$(frequency))
else
n = foreign_function_call("kernel32.dll", "uint8","Beep","uint32",frequency,"uint32",duration)
end if
end sub
 
MyBeep(440)</lang>
 
=={{header|zkl}}==
672

edits