HH
VS1005 VSOS A
UDIO
S
UBSYSTEM
VS1005g
6.3
VSOS Audio Input/Output Example Program
The following audio program reads audio from the default input, and sends it to the
default output, until the user pushes Ctrl-C in the VSOS Shell Environment.
#include <vo_stdio.h>
#include <apploader.h> // Contains LoadLibrary() and DropLibrary()
#include <consolestate.h>
#define BUFSIZE 128
ioresult main(char *parameters) {
static s_int16 myBuf[BUFSIZE];
if (!stdaudioin || !stdaudioout) {
printf("E: NO AUDIO IN OR OUT!\n");
return S_ERROR;
}
while (!(appFlags & APP_FLAG_QUIT)) { /* Until Ctrl-C is pushed */
fread(myBuf, sizeof(s_int16), BUFSIZE, stdaudioin);
fwrite(myBuf, sizeof(s_int16), BUFSIZE, stdaudioout);
}
return S_OK;
}
Rev. 3.57
2019-04-10
Page