b = audio_name.record(ʃsecondsʅ);
The
Audio.record function starts recording audio in the background and stores the recorded audio in an
Audio object. The call to record begins audio recording and returns immediately. Recording continues until the
Audio.stop function is called. If the optional parameter
seconds is specified, recording will stop after the specified number of seconds have elapsed—or
Audio.stop—is called, whichever action comes first.
While the audio is recording, CSPro continues to run and the user is able to enter responses and move around the questionnaire as usual. This is useful if you wish to record portions of the interview for audit purposes. If instead you wish to record audio synchronously, for example to record the response to a single question, use the
Audio.recordInteractive function instead.
The recorded audio is stored in the
Audio object and can be played back using
Audio.play or saved to a file using
Audio.save. If the
Audio object already contains an audio recording, the recorded audio will be appended to the existing recording. To replace the existing recording rather than adding to it, call the
Audio.clear function before calling
Audio.record.
Recorded audio is stored in m4a format (AAC encoded in an MPEG-4 container). Files should be saved with the extension .m4a so that they will be recognized by media players.
Audio recording is only supported on Android. This function will do nothing on Windows.
The function returns a logical value of 1 (true) if the recording is started successfully and 0 (false) otherwise.