Beispiel #1
0
// Release and free audio card.
// returns 0 for success, -1 for failure
int HAE_ReleaseAudioCapture(void *context)
{
    //fprintf(stderr, ">> HAE_API_LinuxOS_Capture: HAE_ReleaseAudioCapture()\n");

    // play it safe: destroy thread if not already done
    if (!g_captureShutdown) {
	HAE_StopAudioCapture(context);
    }

    HAE_CloseSoundCard(1); // CLose for capture

    //fprintf(stderr, "<< HAE_API_LinuxOS_Capture: HAE_ResumeAudioCapture() returning 0\n");
    return 0;
}
Beispiel #2
0
// Release and free audio card.
// returns 0 for success, -1 for failure
int HAE_ReleaseAudioCapture(void *context) {
    //fprintf(stderr, ">> HAE_API_SolarisOS_Capture: HAE_ReleaseAudioCapture()\n");
	
    if (!g_captureShutdown) {
	HAE_StopAudioCapture(context);
    }

    if (g_captureSound) {
	close(g_captureSound);
	g_captureSound = 0;
    }

    //fprintf(stderr, "<< HAE_API_SolarisOS_Capture: HAE_ResumeAudioCapture() returning 0\n");	
    return 0;
}
Beispiel #3
0
// Release and free audio card.
// return 0 if ok, -1 if failed.
int HAE_ReleaseAudioCapture(void *context) {
    TRACE0("> HAE_ReleaseAudioCapture\n");
    if (g_captureSound) {
	    // play it safe: destroy thread if not already done
	    if (!g_captureShutdown) {
		HAE_StopAudioCapture(context);
	    }

	    //printf("  WaveInClose\n");
	    while (waveInClose(g_captureSound) == WAVERR_STILLPLAYING) {
		    HAE_SleepFrameThread(context, 10); // in millis
		}
	    g_waveInStarted = FALSE;
	    g_captureSound = NULL;
	}
    TRACE0("< HAE_ReleaseAudioCapture\n");
    return 0;
}
Beispiel #4
0
// once a stream has been setup, call this function to stop the capture
OPErr GM_AudioCaptureStreamStop(void* threadContext, void *reference)
{
    GM_CaptureAudioStream	*pStream;
    OPErr					theErr;

    theErr = NO_ERR;
    pStream = PV_CaptureAudioStreamGetFromReference(reference);
    if (pStream)
	{
	    // stop buffer capture
	    if (HAE_StopAudioCapture(threadContext))
		{
		    theErr = DEVICE_UNAVAILABLE;
		}
	}
    else
	{
	    theErr = INVALID_REFERENCE;
	}

    return theErr;
}