Esempio n. 1
0
static ReturnCodes setupOutputSource(SampleSource outputSource) {
  if(outputSource == NULL) {
    return RETURN_CODE_INVALID_ARGUMENT;
  }
  if(!outputSource->openSampleSource(outputSource, SAMPLE_SOURCE_OPEN_WRITE)) {
    logError("Output source '%s' could not be opened", outputSource->sourceName->data);
    return RETURN_CODE_IO_ERROR;
  }

  return RETURN_CODE_SUCCESS;
}
Esempio n. 2
0
static ReturnCodes setupInputSource(SampleSource inputSource) {
  if(inputSource == NULL) {
    return RETURN_CODE_INVALID_ARGUMENT;
  }
  if(inputSource->sampleSourceType == SAMPLE_SOURCE_TYPE_PCM) {
    sampleSourcePcmSetSampleRate(inputSource, getSampleRate());
    sampleSourcePcmSetNumChannels(inputSource, getNumChannels());
  }
  if(!inputSource->openSampleSource(inputSource, SAMPLE_SOURCE_OPEN_READ)) {
    logError("Input source '%s' could not be opened", inputSource->sourceName->data);
    return RETURN_CODE_IO_ERROR;
  }

  return RETURN_CODE_SUCCESS;
}