CY8CKIT-046 PSoC® 4 L-Series Pioneer Kit Guide, Doc. #: 002-03344 Rev. *D
51
Code Examples
6. Any audio playback software can be used to stream audio to the external audio device. The
audio sample rate of the device can be configured by selecting
Start
>
Control Panel
>
Sound
in the
Playback
tab, select
Speakers (CY8CKIT-046 USB
Audio)
, and click
Properties
. See
. Similarly, any audio recording software can be used to read the microphone data
and record the same. Note that the sample rate for speakers/headphones and microphone of the
CY8CKIT-046 USB Audio device cannot be different. However, there is no way to synchronize
the data in the
Playback
and
Recording
tab in Sound settings. Hence, when you update the
sample rate in any tab of the CY8CKIT-046 USB Audio device, you need to manually update the
same sample rate in the other tab as well for proper glitch-free streaming of audio between the
kit and the PC.
Figure 4-24. Setting Audio Sample Rate for Speakers
7. Use the gestures described in
to control the audio streaming and playback.
Note that the volume control between the PC and the playback device depends on the operating
system. This is because each operating system uses its own volume to decibel (dB) conversion
logic. In general, the volume output from a PC is in the range of –127 dB to +127 dB. However,
due to custom implementation, the minimum, maximum, and offset in the volume can be different
between operating systems. For instance, Windows 7 sends volume output in the range of +50
dB to +127 dB. In Windows 10, the volume changes from –50 dB to +50 dB. Mac OS, however,
uses the full range –127 dB to +127 dB. Because there is no easy way to detect the OS through
the USB Audio interface, the VOLUME_CTRL macro, has been provided in the '
Config.h
' file. Set
this macro to the appropriate OS to let the volume control module know, which OS will be used. If
the OS used is not listed in the list of supported OS macros, use the 'MAC_VOLUME_CTL'
macro.