Presumably, 0.0 maps to the -52 dB setting and 1.0 maps to the +12 dB setting. For example, it allows the user to control the headphone volume simply by commanding a value somewhere between 0.0 and 1.0. The library hides many of the details of controlling the SGTL5000. Teensy Audio Library: Because this SGTL5000 is embedded within the Teensy Audio Board, I control it via the Teensy Audio Library. It says that the headphone volume can be adjusted from -52 dB to +12 dB. The headphone volume control is at the end of the chain, on the upper right. All of the blocks in yellow are analog gain stages. System Block Diagram: The figure above is taken from the datasheet for the SGTL5000. Go under the "File" menu and select "Examples", then, "OpenAudio_ArduinoLibrary", then "BasicGain_Float". OpenAudio F32 Example: If you download the library and unzip it into your Arduino Libraries directory (see "Installation" notes here), you can start the Arduino IDE and load an example sketch that comes with the library. My conversion routines automatically account for this difference. The Teensy Audio Library assumes "full scale" is ☓2768 whereas my floating-point objects assume that ☑.0 is full scale. In addition to converting between the Int16 and Float32 data types, these routines also re-scale the data. To maintain the structure and conventions of the Teensy Audio Library, I made a one-for-one replacement so that one only need to substitute the " _F32" version for the standard version.Ĭonversion Routines: To interface between the Int16 data of the Teensy Audio Library and the Float32 data used my extended library, I also wrote two new " AudioConvert" classes. I used inheritance where possible to reduce the duplication of functionality, particularly for the AudioStream to AudioStream_F32 conversion. OpenAudio F32 Versions: To enable Float32 operations, I wrote new Float32 versions of these elements. Shown in red in the figure above are several of the foundational elements of the Teensy Audio Library that are tied to Int16 audio data. But, many of the core elements of the Teensy Audio Library are deeply entwined with the assumption of fixed-point Int16 audio data. Teensy Audio Library Assumes Int16: My goal has been to maintain as much of the Teensy Audio Library's structure as possible.
0 Comments
Leave a Reply. |