AudioCapturerHandle audioCapturerCreate()

in source/T31/T31AudioCapturer.c [54:74]


AudioCapturerHandle audioCapturerCreate(void)
{
    T31AudioCapturer* t31Handle = NULL;

    if (!(t31Handle = (T31AudioCapturer*) malloc(sizeof(T31AudioCapturer)))) {
        LOG("OOM");
        return NULL;
    }

    memset(t31Handle, 0, sizeof(T31AudioCapturer));

    // Now implementation supports raw PCM, G.711 ALAW and ULAW, MONO, 8k/16k, 16 bits
    t31Handle->capability.formats = (1 << (AUD_FMT_G711A - 1)) | (1 << (AUD_FMT_G711U - 1)) | (1 << (AUD_FMT_PCM - 1));
    t31Handle->capability.channels = (1 << (AUD_CHN_MONO - 1));
    t31Handle->capability.sampleRates = (1 << (AUD_SAM_8K - 1)) | (1 << (AUD_SAM_16K - 1));
    t31Handle->capability.bitDepths = (1 << (AUD_BIT_16 - 1));

    setStatus((AudioCapturerHandle) t31Handle, AUD_CAP_STATUS_STREAM_OFF);

    return (AudioCapturerHandle) t31Handle;
}