• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
      • Statement Format Symbols
      • Alphabetical List of Functions and Statements
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Symbol Functions
      • Item Functions
      • Array Object
      • Audio Object
        • Audio Statement
        • Audio.load Function
        • Audio.save Function
        • Audio.play Function
        • Audio.recordInteractive Function
        • Audio.record Function
        • Audio.stop Function
        • Audio.concat Function
        • Audio.length Function
        • Audio.clear Function
      • Barcode and QR Codes
      • Case Object
      • Document Object
      • File Object
      • Freq Object
      • Geometry Object
      • HashMap Object
      • Image Object
      • List Object
      • Map Object
      • Path
      • Pff Object
      • SystemApp Object
      • ValueSet Object
      • Program Control Statements
      • Assignment Statements
      • Data Entry Statements and Functions
      • Batch Edit Statements
      • Numeric Functions
      • String Functions
      • Multiple Occurrence Functions
      • General Functions
      • Date and Time Functions
      • External File Functions
      • Synchronization Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

Audio.concat Function

Format
b = audio_name.concat(audio_filename ‖ audio_object);
Description
The Audio.concat function appends an audio recording stored in a file specified by the argument audio_filename or an Audio object specified by the argument audio_object to the current recording in an Audio object. The result is a new recording that combines both recordings and is stored in the initial Audio object.
The Audio.concat function only works with audio files stored in m4a format (AAC encoded audio stored in an MPEG-4 container). This is the format of files recorded in CSPro using the Audio.record and Audio.recordInteractive functions. Audio files that come from sources other than CSPro will most likely not work with Audio.concat.
Return Value
The function returns a logical value of 1 (true) if the recordings were concatenated successfully and a logical value of 0 (false) if there was an error combining the recordings.
Example 1
Audio recording;

recording.
load("recording1.m4a");
recording.
concat("recording2.m4a");
recording.
save("combined.m4a");
Example 2
PROC GLOBAL

Audio recordingQ1;
Audio recordingQ2;

PROC SURVEY_LEVEL

   
// at end of questionnaire combine audio recordings from Q1 and Q2 and save
    Audio combined;
    combined = recordingQ1;
    combined.
concat(recordingQ2);
   
string audioFilename = maketext("recording%v.m4a", HOUSEHOLD_ID);
    combined.
save(audioFilename);

PROC Q1
preproc
    recordingQ1.
record();

postproc
    recordingQ1.
stop();

PROC Q2
preproc
    recordingQ2.
record();

postproc
    recordingQ2.
stop();
See also: Audio Object