예제 #1
0
	result portaudio_init(SoLoud::Soloud *aSoloud, unsigned int aFlags, unsigned int aSamplerate, unsigned int aBuffer, unsigned int aChannels)
	{
		if (!dll_Pa_found())
			return DLL_NOT_FOUND;

		aSoloud->postinit(aSamplerate, aBuffer * 2, aFlags, 2);
		aSoloud->mBackendCleanupFunc = soloud_portaudio_deinit;
		dll_Pa_Initialize();
		dll_Pa_OpenDefaultStream(&gStream, 0, 2, paFloat32, aSamplerate, paFramesPerBufferUnspecified, portaudio_callback, (void*)aSoloud);
		dll_Pa_StartStream(gStream);
        aSoloud->mBackendString = "PortAudio";
		return 0;
	}
예제 #2
0
	int portaudio_init(SoLoud::Soloud *aSoloud, int aFlags, int aSamplerate, int aBuffer)
	{
		if (!dll_Pa_found())
			return DLL_NOT_FOUND;

		aSoloud->postinit(aSamplerate, aBuffer * 2, aFlags);
		aSoloud->mBackendCleanupFunc = soloud_portaudio_deinit;
		aSoloud->mMutex = Thread::createMutex();
		aSoloud->mLockMutexFunc = portaudio_mutex_lock;
		aSoloud->mUnlockMutexFunc = portaudio_mutex_unlock;
		dll_Pa_Initialize();
		dll_Pa_OpenDefaultStream(&gStream, 0, 2, paFloat32, aSamplerate, paFramesPerBufferUnspecified, portaudio_callback, (void*)aSoloud);
		dll_Pa_StartStream(gStream);
		return 0;
	}