Esempio n. 1
0
File: snd_ogg.c Progetto: ZwS/qudos
/*
==========
OGG_Read

Play a portion of the currently opened file.
==========
*/
int OGG_Read(void)
{
	int res;	/* Number of bytes read. */

	/* Read and resample. */
	res = ov_read(&ovFile, ovBuf, sizeof(ovBuf), 0, 2, 1, &ovSection);
	S_RawSamplesVol(res>>2, 44100, 2, 2, (byte*)ovBuf, ogg_volume->value);

	/* Check for end of file. */
	if (res == 0) {
		OGG_Stop();
		OGG_Sequence();
	}

	return (res);
}
Esempio n. 2
0
/*
 * Play a portion of the currently opened file.
 */
int
OGG_Read ( void )
{
	int res;    /* Number of bytes read. */

	/* Read and resample. */
	res = ov_read( &ovFile, ovBuf, sizeof ( ovBuf ), ogg_bigendian, OGG_SAMPLEWIDTH, 1, &ovSection );
	S_RawSamples( res / (OGG_SAMPLEWIDTH * ogg_info->channels),
		      ogg_info->rate, OGG_SAMPLEWIDTH, ogg_info->channels, (byte *) ovBuf, ogg_volume->value );

	/* Check for end of file. */
	if ( res == 0 )
	{
		OGG_Stop();
		OGG_Sequence();
	}

	return ( res );
}