Beispiel #1
0
// Buffer fill-upper
void fill_audio(void *data,Uint8 *stream,int len)
{
    short *buff;
	int i;
	// Cast
	buff = (short*)stream;
	len /= 2; //Because we're now using shorts
	//Noise


	for(i = 0;i < len;i+=2){
		//buff[i] = (short)(30000 * osc_squ(pitch + sin((double)(t/10000.0)),t) );

		while(ticker > (int)(CHANNELS*FREQUENCY/p->ticks_per_second)){
            player_forward(p);
            ticker -=  (int)(CHANNELS*FREQUENCY/p->ticks_per_second);
		}ticker+=2;
		buff[i] = mixer_render(m,t);
		buff[i+1] = buff[i];

		t+=2;
    }

}
Beispiel #2
0
static void emit_audio()
{
   mixer_render(audio_buffer);
   audio_batch_cb(audio_buffer, AUDIO_FRAMES);
}