arduino-audio-tools
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OversamplingDAC Class Referenceabstract

Abstract Software Implementation of an Oversampling DAC. More...

#include <AudioDAC.h>

Inheritance diagram for OversamplingDAC:
AudioOutput Print AudioInfoSupport AudioInfoSource OversamplingDAC32 PWMDAC SimpleDAC SerialDAC

Public Member Functions

virtual void addNotifyAudioChange (AudioInfoSupport &bi)
 Adds target to be notified about audio changes.
 
virtual AudioInfo audioInfo () override
 provides the actual input AudioInfo
 
virtual AudioInfo audioInfoOut ()
 provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
 
virtual int availableForWrite () override
 
virtual bool begin ()
 
virtual bool begin (AudioInfo info)
 
virtual bool begin (DACInfo cfg)
 starts the Delta Sigma DAC
 
virtual void clearNotifyAudioChange ()
 Deletes all change notify subscriptions.
 
virtual DACInfo defaultConfig ()
 
virtual void end ()
 Stops the output.
 
virtual void flush ()
 
bool isBlocking ()
 
virtual bool isDeletable ()
 If true we need to release the related memory in the destructor.
 
bool isNotifyActive ()
 Checks if the automatic AudioInfo update is active.
 
virtual operator bool ()
 
virtual uint32_t outputFrameCount ()
 To be used for testing, we just count the number of frames that were sent to output.
 
virtual uint32_t outputRate ()=0
 
virtual bool removeNotifyAudioChange (AudioInfoSupport &bi)
 Removes a target in order not to be notified about audio changes.
 
virtual void setAudioInfo (AudioInfo newInfo) override
 Defines the input AudioInfo.
 
void setBlocking (bool blocking)
 
void setNotifyActive (bool flag)
 Deactivate/Reactivate automatic AudioInfo updates: (default is active)
 
TimerAlarmRepeatingtimer ()
 
virtual size_t write (const uint8_t *data, size_t len)
 Writes the audio data to the output buffer.
 
virtual size_t write (uint8_t c)
 Writes a single byte (of audio data) to the output buffer.
 
virtual void writeSilence (size_t len)
 

Protected Member Functions

virtual size_t availableFramesToWrite ()=0
 determines how many frames we can write to the buffer
 
void notifyAudioChange (AudioInfo info)
 
virtual void quantize (int16_t newSamp, int left_right_idx)=0
 updates the buffer with analog value (represented by number of 1)
 
virtual void reset ()
 Releases the memory.
 
virtual void startTimer ()=0
 

Protected Attributes

int _timeout = 10
 
bool active
 
uint8_t bytes_per_sample = 2
 
AudioInfo cfg
 
int32_t * cummulated_error = nullptr
 
int current_bit = -1
 
int32_t * current_values = nullptr
 
const int fixedPosValue =0x007fff00
 
DACInfo info
 
bool is_active = false
 
bool is_blocking = true
 
bool is_notify_active = true
 
int32_t * last_values = nullptr
 
Vector< AudioInfoSupport * > notify_vector
 
DACOut out
 
TimerAlarmRepeating timer_object
 
SingleBuffer< uint8_t > tmp {MAX_SINGLE_CHARS}
 
int tmpPos = 0
 
uint8_t write_buffer [4]
 
int write_buffer_pos = 0
 

Detailed Description

Abstract Software Implementation of an Oversampling DAC.

Author
Phil Schatzmann

Member Function Documentation

◆ writeSilence()

virtual void writeSilence ( size_t  len)
inlinevirtualinherited

Writes n 0 values (= silence)

Parameters
len

The documentation for this class was generated from the following file: