HH
VS1005 VSOS A
UDIO
S
UBSYSTEM
VS1005g
6
The VS1005 VSOS Audio Subsystem
As a default, VSOS offers a simple audio output driver that lets the user output 16-bit
mono or stereo audio to the VS1005 analog output pins LEFT and RIGHT, and control
the sample rate.
VSOS Audio makes it very easy to produce sound with its standard-C-like standard
audio interface (Chapter 6.1,
Standard Audio
). Instead of being forced to use audio-
specific I/O routines, audio looks just like files.
More complex audio operations and redirections can be done using the audio drivers,
described Chapter 7,
Audio Drivers
.
6.1
Standard Audio
VSOS offers the user a standard audio source and destination, although the audio
source is only activated if an appropriate audio input driver is loaded (Chapter 7). Called
stdaudioin
and
stdaudioout
, standard audio file handles are to sound much like
stdin
and
stdout
are to standard input and output in standard C. It is not allowed for the user
to close standard audio input or output files, but the user may modify their parameters.
By default,
stdaudioout
is connected to analog output pins LEFT and RIGHT, although
this can be changed with appropriate audio drivers.
Both standard audio input and output open in stereo, 16-bit, 48 kHz mode. These pa-
rameters can be changed by the user, with driver and hardware dependent limitations.
The user may use all standard read and write operations to read from and write to
standard audio. It is, however, required that fread() / fwrite() functions are used instead
of character-based operations like fgetc() and fprintf(). It is also recommended to handle
larger chunks of samples, like 32, at a time.
Stereo samples are stored in an interleaved fashion. In 32-bit mode, the least significant
word is stored first. This is the same as the native VSDSP 32-bit word order.
Audio sample buffer 16-bit word order
Audio format
Word 0
Word 1
Word 2
Word 3
16-bit stereo
Left 0
Right 0
Left 1
Right 1
32-bit stereo
Left 0 LSW
Left 0 MSW
Right 0 LSW
Right 0 MSW
Rev. 3.57
2019-04-10
Page