arduino-audio-tools
|
AudioKit Stream which uses the https://github.com/pschatzmann/arduino-audiokit library. More...
#include <AudioKit.h>
Public Member Functions | |
void | addAction (int pin, void(*action)(bool, int, void *), AudioActions::ActiveLogic activeLogic, void *ref=nullptr) |
Defines a new action that is executed when the indicated pin is active. | |
void | addAction (int pin, void(*action)(bool, int, void *), void *ref=nullptr) |
Defines a new action that is executed when the indicated pin is active. | |
virtual void | addNotifyAudioChange (AudioInfoSupport &bi) |
Adds target to be notified about audio changes. | |
AudioActions & | audioActions () |
Provides access to the AudioActions. | |
virtual AudioInfo | audioInfo () override |
provides the actual input AudioInfo | |
virtual AudioInfo | audioInfoOut () |
int | available () |
We get the data via I2S - we expect to fill one buffer size. | |
virtual int | availableForWrite () override |
bool | begin () override |
bool | begin (AudioKitStreamConfig config) |
Starts the processing. | |
virtual void | clearNotifyAudioChange () |
Deletes all change notify subscriptions. | |
AudioKitStreamConfig & | config () |
AudioKitStreamConfig | defaultConfig (RxTxMode mode=RXTX_MODE) |
Provides the default configuration. | |
void | end () override |
Stops the processing. | |
virtual void | flush () override |
bool | headphoneStatus () |
Returns true if the headphone was detected. | |
void | incrementVolume (int vol) |
Relative volume control. | |
bool | isNotifyActive () |
Checks if the automatic AudioInfo update is active. | |
virtual | operator bool () |
int8_t | pinAdcDetect () |
Get the gpio number for adc detection. | |
int8_t | pinAuxin () |
Get the gpio number for auxin detection. | |
int8_t | pinBlueLed () |
Get green led gpio number. | |
int8_t | pinEs7243Mclk () |
Get the mclk gpio number of es7243. | |
int8_t | pinGreenLed () |
Get DSP reset gpio number. | |
int8_t | pinHeadphoneDetect () |
Get the gpio number for headphone detection. | |
int8_t | pinInputMode () |
Get the number for mode-button. | |
int8_t | pinInputPlay () |
Get number for play function. | |
int8_t | pinInputRec () |
Get the record-button id for adc-button. | |
int8_t | pinInputSet () |
Get number for set function. | |
int8_t | pinPaEnable () |
Get the gpio number for PA enable. | |
int8_t | pinResetBoard () |
Get DSP reset gpio number. | |
int8_t | pinResetCodec () |
Get green led gpio number. | |
int8_t | pinVolumeDown () |
Get number for volume down function. | |
int8_t | pinVolumeUp () |
number for volume up function | |
void | processActions () |
Process input keys and pins. | |
size_t | readBytes (uint8_t *data, size_t len) override |
Reads the audio data. | |
virtual size_t | readSilence (uint8_t *buffer, size_t length) |
Source to generate silence: just sets the buffer to 0. | |
virtual bool | removeNotifyAudioChange (AudioInfoSupport &bi) |
Removes a target in order not to be notified about audio changes. | |
bool | setActive (bool active) |
Sets the codec active / inactive. | |
void | setAudioInfo (AudioInfo info) override |
bool | setMute (bool mute) |
Mutes the output. | |
void | setNotifyActive (bool flag) |
Deactivate/Reactivate automatic AudioInfo updates: (default is active) | |
void | setSpeakerActive (bool active) |
bool | setVolume (double vol) |
Defines the Volume: Range 0 to 1.0. | |
bool | setVolume (float vol) |
Defines the Volume: Range 0 to 1.0. | |
bool | setVolume (int vol) |
Defines the Volume: Range 0 to 100. | |
int | volume () |
Determines the volume. | |
size_t | write (const uint8_t *data, size_t len) override |
virtual size_t | write (uint8_t ch) override |
virtual void | writeSilence (size_t len) |
Writes len bytes of silence (=0). | |
Protected Member Functions | |
AudioActions::ActiveLogic | getActionLogic (int pin) |
Determines the action logic (ActiveLow or ActiveTouch) for the pin. | |
virtual int | not_supported (int out, const char *msg="") |
void | notifyAudioChange (AudioInfo info) |
void | refillReadBuffer () |
void | setupActions () |
Setup the supported default actions. | |
Protected Attributes | |
int | _timeout = 10 |
AudioActions | actions |
bool | active = true |
AudioKitStreamConfig | cfg = defaultConfig(RXTX_MODE) |
I2SStream | i2s_stream |
AudioInfo | info |
bool | is_notify_active = true |
bool | is_started = false |
AudioKit | kit |
Vector< AudioInfoSupport * > | notify_vector |
RingBuffer< uint8_t > | tmp_in {0} |
RingBuffer< uint8_t > | tmp_out {0} |
int | volume_value = 40 |
AudioKit Stream which uses the https://github.com/pschatzmann/arduino-audiokit library.
|
inline |
Defines a new action that is executed when the indicated pin is active.
pin | |
action | |
activeLogic | |
ref |
|
inline |
Defines a new action that is executed when the indicated pin is active.
pin | |
action | |
ref |
|
inlinevirtualinherited |
Adds target to be notified about audio changes.
Reimplemented in CodecNOP, MP3DecoderMAD, EncodedAudioOutput, EncodedAudioStream, AACDecoderFDK, DecoderBasic, MP3DecoderHelix, OggContainerDecoder, Pipeline, and Pipeline::ModifyingStreamAdapter.
|
inlineoverridevirtualinherited |
provides the actual input AudioInfo
Implements AudioInfoSupport.
Reimplemented in JupyterAudioT< T >, MozziStream, TimerCallbackAudioStream, PureDataStream, AdapterAudioOutputToAudioStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, and InputMerge< T >.
|
inlinevirtualinherited |
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
Reimplemented in PureDataStream, PWMAudioOutput, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, FormatConverterStream, Pipeline, and ResampleStream.
|
inlinevirtual |
We get the data via I2S - we expect to fill one buffer size.
Reimplemented from BaseStream.
|
inlineoverridevirtualinherited |
Reimplemented from Print.
Reimplemented in UDPStream, A2DPStream, AudioFFTBase, I2SCodecStream, AbstractURLStream, URLStreamESP32, I2SStream, MeasuringStream, ProgressStream, and VolumeStream.
|
inlineoverridevirtual |
Reimplemented from BaseStream.
|
inlineoverridevirtual |
Stops the processing.
Reimplemented from BaseStream.
|
inlineoverridevirtualinherited |
Reimplemented from Print.
Reimplemented in ResampleStream, BufferedTaskStream, and BufferedStream.
|
inline |
Returns true if the headphone was detected.
|
inline |
Relative volume control.
vol |
|
inlinevirtualinherited |
Reimplemented in A2DPStream, Pipeline, I2SStream, and MemoryStream.
|
inline |
Get the gpio number for adc detection.
|
inline |
Get the gpio number for auxin detection.
|
inline |
Get green led gpio number.
|
inline |
Get the mclk gpio number of es7243.
|
inline |
Get DSP reset gpio number.
|
inline |
Get the gpio number for headphone detection.
|
inline |
Get the number for mode-button.
|
inline |
Get number for play function.
|
inline |
Get the record-button id for adc-button.
|
inline |
Get number for set function.
|
inline |
Get the gpio number for PA enable.
|
inline |
Get DSP reset gpio number.
|
inline |
Get green led gpio number.
|
inline |
Get number for volume down function.
|
inline |
number for volume up function
|
inlineoverridevirtual |
Reads the audio data.
Reimplemented from AudioStream.
|
inlineoverridevirtual |
Update the audio info with new values: e.g. new sample_rate, bits_per_samples or channels.
Reimplemented from AudioStream.
|
inline |
Activates/Deactives the speaker
active |
|
inlineoverridevirtual |
Reimplemented from AudioStream.
|
inlineoverridevirtualinherited |
Reimplemented in BufferedTaskStream, and BufferedStream.