Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
23
Task/Record-sound/ChucK/record-sound.chuck
Normal file
23
Task/Record-sound/ChucK/record-sound.chuck
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// chuck this with other shreds to record to file
|
||||
// example> chuck foo.ck bar.ck rec
|
||||
|
||||
// arguments: rec:<filename>
|
||||
|
||||
// get name
|
||||
me.arg(0) => string filename;
|
||||
if( filename.length() == 0 ) "foo.wav" => filename;
|
||||
|
||||
// pull samples from the dac
|
||||
dac => Gain g => WvOut w => blackhole;
|
||||
// this is the output file name
|
||||
filename => w.wavFilename;
|
||||
<<<"writing to file:", "'" + w.filename() + "'">>>;
|
||||
// any gain you want for the output
|
||||
.5 => g.gain;
|
||||
|
||||
// temporary workaround to automatically close file on remove-shred
|
||||
null @=> w;
|
||||
|
||||
// infinite time loop...
|
||||
// ctrl-c will stop it, or modify to desired duration
|
||||
while( true ) 1::second => now;
|
||||
13
Task/Record-sound/LiveCode/record-sound.livecode
Normal file
13
Task/Record-sound/LiveCode/record-sound.livecode
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
command makeRecording
|
||||
set the dontUseQT to false -- on windows use true
|
||||
set the recordFormat to "wave" -- can be wav,aiff, au
|
||||
set the recordRate to 44.1 -- sample at 44100 Hz
|
||||
set the recordSampleSize to 16 --default is 8 bit
|
||||
ask file "Save recording as"
|
||||
if it is not empty then
|
||||
answer record --show sound input dialog with presets above
|
||||
record sound file it -- actual record command
|
||||
wait 10 seconds
|
||||
stop recording
|
||||
end if
|
||||
end makeRecording
|
||||
12
Task/Record-sound/Nim/record-sound.nim
Normal file
12
Task/Record-sound/Nim/record-sound.nim
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
proc record(bytes): auto =
|
||||
var f = open("/dev/dsp")
|
||||
result = newSeq[int8](bytes)
|
||||
discard f.readBytes(result, 0, bytes)
|
||||
|
||||
proc play(buf) =
|
||||
var f = open("/dev/dsp", fmWrite)
|
||||
f.write(buf)
|
||||
f.close
|
||||
|
||||
var p = record(65536)
|
||||
play(p)
|
||||
Loading…
Add table
Add a link
Reference in a new issue