Version 2.01

This commit is contained in:
Gary Scavone
2013-09-25 11:17:56 +02:00
committed by Stephen Sinclair
parent 6485746ee9
commit ea749b71d2
223 changed files with 12125 additions and 4552 deletions

56
RTWvOut.cpp Normal file
View File

@@ -0,0 +1,56 @@
/*******************************************/
/* Raw Wave File Output Class, */
/* by Perry R. Cook, 1995-96 */
/* This version opens a mono NeXT .snd */
/* file 16bit data at 22KHz, and */
/* pokes buffers of samples into it. */
/*******************************************/
/*******************************************/
/* SGI Real-Time Wave File Output Class, */
/* by Perry R. Cook, 1996 */
/* This Object can opens the SGI soundout */
/* device, and pokes buffers of samples */
/* into it. The real code that does the */
/* is from Doug Scott of SGI. */
/*******************************************/
/*******************************************/
/* USS Real-Time Wave File Output Class, */
/* by Tim Stilson, 1996 */
/* based on code by Perry R. Cook, 1996 */
/* This Object opens the USS sound output */
/* device, and pokes buffers of samples */
/* into it. */
/*******************************************/
#include "RTWvOut.h"
RTWvOut :: RTWvOut()
{
soundIO = new RTSoundIO(SRATE, 1);
counter = 0;
}
RTWvOut :: ~RTWvOut()
{
soundIO->playBuffer(data,counter);
counter = 0;
while (counter<RT_BUFFER_SIZE) {
data[counter++] = 0;
}
soundIO->playBuffer(data,counter);
soundIO->playBuffer(data,counter); // Are these extra writes necessary in USS?
soundIO->playBuffer(data,counter);
delete soundIO;
}
void RTWvOut :: tick(MY_FLOAT sample)
{
data[counter++] = (short) (sample * 32000.0);
if (counter >= RT_BUFFER_SIZE) {
soundIO->playBuffer(data,counter);
counter = 0;
}
}