sample/vs_android.cc
/**
 * Creates an audio stream for recording. The audio device used will depend on recordingDeviceId_.
 * If the value is set to AAUDIO_UNSPECIFIED then the default recording device will be used.
 */
Creates an audio stream for recording. The audio device used will depend on recordingDeviceId_.
If the value is set to AAUDIO_UNSPECIFIED then the default recording device will be used.
Creates an audio stream for recording . The audio device used will depend on recordingDeviceId_ . If the value is set to AAUDIO_UNSPECIFIED then the default recording device will be used .
bool VsAndroidCapture::openRecordingStream() {
  AAudioStreamBuilder *builder = createStreamBuilder();
  if (builder != nullptr) {
    setupRecordingStreamParameters(builder);
    aaudio_result_t result = AAudioStreamBuilder_openStream(builder, &recordingStream_);
    if (result == AAUDIO_OK && recordingStream_ != nullptr) {
      warnIfNotLowLatency(recordingStream_);
      PrintAudioStreamInfo(recordingStream_);
    } else {
      printf("Failed to create recording stream. Error: %s\n", AAudio_convertResultToText(result));
      return false;
    }
    AAudioStreamBuilder_delete(builder);
  } else {
    printf("Unable to obtain an AAudioStreamBuilder object\n");
    return false;
  }
  return true;
}
bool VsAndroidCapture :: openRecordingStream ( ) { AAudioStreamBuilder * builder = createStreamBuilder ( ) ; if ( builder != nullptr ) { setupRecordingStreamParameters ( builder ) ; aaudio_result_t result = AAudioStreamBuilder_openStream ( builder , & recordingStream_ ) ; if ( result == AAUDIO_OK && recordingStream_ != nullptr ) { warnIfNotLowLatency ( recordingStream_ ) ; PrintAudioStreamInfo ( recordingStream_ ) ; } else { printf ( " \n " , AAudio_convertResultToText ( result ) ) ; return false ; } AAudioStreamBuilder_delete ( builder ) ; } else { printf ( " \n " ) ; return false ; } return true ; }
Creates an audio stream for recording.
Creates an audio stream for recording .
// To create a stream we use a stream builder. This allows us to specify all the parameters // for the stream prior to opening it // Now that the parameters are set up we can open the stream