Esempio n. 1
0
//----------------------------------------------------------------
ALboolean swAudioLoaderLoadOggStream(ALuint oalSourceID, ALuint* oalBufferID, AudioBuffer *aB){
	aB->ulBytesWritten = decodeOgg(aB);
	if (aB->ulBytesWritten){
		alBufferData((*oalBufferID), aB->ulFormat, aB->pDecodeBuffer, aB->ulBytesWritten, aB->ulFrequency);
		alSourceQueueBuffers(oalSourceID, 1, oalBufferID);
	}
	return AL_TRUE;
}
Esempio n. 2
0
bool OGG_Loader::decode(ResourceLoadOptions& options)
{
	Sound* sound = static_cast<Sound*>( options.resource );
	
	if( sound->getStreamed() )
		return true;

	OggVorbis_File oggFile;
	OggVorbis_File* p_oggFile = &oggFile;
	
	// Initialize the sound. 
	if( !initOgg(p_oggFile, options) )
		return false;

	// Decode the sound into a buffer now.
	Array<byte>& buffer = sound->dataBuffer;
	decodeOgg( &oggFile, buffer );

	ov_clear(&oggFile);

	return true;
}