|
|
Line 273: |
Line 273: |
|
(play (record 65536)) |
|
(play (record 65536)) |
|
</syntaxhighlight> |
|
</syntaxhighlight> |
|
|
|
|
⚫ |
|
|
⚫ |
This <code>funct</code>ion returns a <code>{wav}</code> variable recorded from a thing in the mist. It understands that the found <code>thing</code> has a microphone, so will have microphone knowledge. If the caller does not have microphone knowledge, the callee will train the caller on first request. |
|
⚫ |
<syntaxhighlight lang="diego">begin_funct({wav}, Record sound); |
|
⚫ |
|
|
⚫ |
find_thing()_first()_microphone()_bitrate(16)_tech(PCM)_samplerate(signed16, unsigned16)_rangefrom(8000, Hz)_rangeto(44100, Hz)_export(.wav) |
|
⚫ |
? with_found()_microphone()_label(mic); |
|
⚫ |
: err_funct[]_err(Sorry, no one has a microphone!); |
|
⚫ |
|
|
⚫ |
|
|
⚫ |
with_microphone[mic]_record()_durat({secs}, 30)_var(recording); |
|
⚫ |
[Record sound]_ret([recording]); |
|
⚫ |
|
|
⚫ |
|
|
|
|
|
⚫ |
// Record a monophonic 16-bit PCM sound into memory space: |
|
⚫ |
exec_funct(Record sound)_var(PCMRecording)_me(); // The variable 'PCMRecording' is the sound in memory space |
|
|
|
|
⚫ |
// Record a monophonic 16-bit PCM sound into a file or array: |
|
⚫ |
exec_funct(Record sound)_file(foo.wav)_me(); // The file 'foo.wav' is the sound in a file</syntaxhighlight> |
|
|
|
|
⚫ |
This is the <code>instruct</code>ion version, where the thing keeps the recording. |
|
⚫ |
<syntaxhighlight lang="diego">begin_instruct(Record sound); |
|
⚫ |
|
|
⚫ |
find_thing()_first()_microphone()_bitrate(16)_tech(PCM)_samplerate(signed16, unsigned16)_rangefrom(8000, Hz)_rangeto(44100, Hz)_export(.wav) |
|
⚫ |
? with_found()_label(recorder)_microphone()_label(mic); |
|
⚫ |
: err_instruct[]_err(Sorry, no one has a microphone!); |
|
⚫ |
|
|
⚫ |
|
|
⚫ |
with_microphone[mic]_record()_durat({secs}, 30)_var(recording); |
|
⚫ |
|
|
⚫ |
|
|
|
|
|
⚫ |
// Record a monophonic 16-bit PCM sound into memory space: |
|
⚫ |
exec_instruct(Record sound)_me(); |
|
⚫ |
with_thing[recorder]_microphone[mic]_var[recording]_var(PCMRecording); // The variable 'PCMRecording' is the sound in memory space |
|
|
|
|
⚫ |
// Record a monophonic 16-bit PCM sound into a file or array: |
|
⚫ |
exec_instruct(Record sound)_me(); |
|
⚫ |
with_thing[recorder]_microphone[mic]_var[recording]_file(foo.wav)_me(); // The file 'foo.wav' is the sound in a file</syntaxhighlight> |
|
|
|
|
|
=={{header|FreeBASIC}}== |
|
=={{header|FreeBASIC}}== |
Line 396: |
Line 436: |
|
fmt.Println("Play-back completed.") |
|
fmt.Println("Play-back completed.") |
|
}</syntaxhighlight> |
|
}</syntaxhighlight> |
|
|
|
⚫ |
|
|
⚫ |
This <code>funct</code>ion returns a <code>{wav}</code> variable recorded from a thing in the mist. It understands that the found <code>thing</code> has a microphone, so will have microphone knowledge. If the caller does not have microphone knowledge, the callee will train the caller on first request. |
|
⚫ |
<syntaxhighlight lang="diego">begin_funct({wav}, Record sound); |
|
⚫ |
|
|
⚫ |
find_thing()_first()_microphone()_bitrate(16)_tech(PCM)_samplerate(signed16, unsigned16)_rangefrom(8000, Hz)_rangeto(44100, Hz)_export(.wav) |
|
⚫ |
? with_found()_microphone()_label(mic); |
|
⚫ |
: err_funct[]_err(Sorry, no one has a microphone!); |
|
⚫ |
|
|
⚫ |
|
|
⚫ |
with_microphone[mic]_record()_durat({secs}, 30)_var(recording); |
|
⚫ |
[Record sound]_ret([recording]); |
|
⚫ |
|
|
⚫ |
|
|
|
|
|
⚫ |
// Record a monophonic 16-bit PCM sound into memory space: |
|
⚫ |
exec_funct(Record sound)_var(PCMRecording)_me(); // The variable 'PCMRecording' is the sound in memory space |
|
|
|
|
⚫ |
// Record a monophonic 16-bit PCM sound into a file or array: |
|
⚫ |
exec_funct(Record sound)_file(foo.wav)_me(); // The file 'foo.wav' is the sound in a file</syntaxhighlight> |
|
|
|
|
⚫ |
This is the <code>instruct</code>ion version, where the thing keeps the recording. |
|
⚫ |
<syntaxhighlight lang="diego">begin_instruct(Record sound); |
|
⚫ |
|
|
⚫ |
find_thing()_first()_microphone()_bitrate(16)_tech(PCM)_samplerate(signed16, unsigned16)_rangefrom(8000, Hz)_rangeto(44100, Hz)_export(.wav) |
|
⚫ |
? with_found()_label(recorder)_microphone()_label(mic); |
|
⚫ |
: err_instruct[]_err(Sorry, no one has a microphone!); |
|
⚫ |
|
|
⚫ |
|
|
⚫ |
with_microphone[mic]_record()_durat({secs}, 30)_var(recording); |
|
⚫ |
|
|
⚫ |
|
|
|
|
|
⚫ |
// Record a monophonic 16-bit PCM sound into memory space: |
|
⚫ |
exec_instruct(Record sound)_me(); |
|
⚫ |
with_thing[recorder]_microphone[mic]_var[recording]_var(PCMRecording); // The variable 'PCMRecording' is the sound in memory space |
|
|
|
|
⚫ |
// Record a monophonic 16-bit PCM sound into a file or array: |
|
⚫ |
exec_instruct(Record sound)_me(); |
|
⚫ |
with_thing[recorder]_microphone[mic]_var[recording]_file(foo.wav)_me(); // The file 'foo.wav' is the sound in a file</syntaxhighlight> |
|
|
|
|
|
|
=={{header|GUISS}}== |
|
=={{header|GUISS}}== |