The microphone can start recording using either a programmatic command, or by just clicking on the component.
>
|
SetProperty("Microphone0", record, true);
|
Once the microphone is recording, its "value" is a storage buffer that holds up to the microphone's sample rate divided by 2 values. In order to record a sound, this buffer needs to be continually emptied into another storage table.
>
|
R := GetProperty("Microphone0", value);
|
The microphone can be turned off either programmatically or by clicking on the microphone component again.
>
|
SetProperty("Microphone0", record, false);
|
Certain properties of the microphone can be set or retrieved from the microphone:
>
|
rate := GetProperty("Microphone0", samplerate);
|
The AudioTools:-Record command can be used to capture a sample of a given duration:
>
|
Recording := AudioTools:-Record(2*Unit('s'), "Microphone0");
|
If a speaker component is present, this rtable can be played back, otherwise the AudioTools:-Preview command can display the dynamics of this sound.
>
|
AudioTools:-Preview(Recording, output = embed);
|