|
arduino-audio-tools
|
I2SCodecStream on the desktop: output to (and input from) the sound card with miniaudio. More...
#include <I2SCodecStreamDesktop.h>


Public Member Functions | |
| I2SCodecStream ()=default | |
| I2SCodecStream ()=default | |
| Default Constructor (w/o codec) | |
| I2SCodecStream (AudioBoard &board) | |
| Default constructor: for available AudioBoard values check audioboard variables in https://pschatzmann.github.io/arduino-audio-driver/html/group__audio__driver.html Further information can be found in https://github.com/pschatzmann/arduino-audio-driver/wiki. | |
| I2SCodecStream (AudioBoard *board) | |
| Provide board via pointer. | |
| template<class Board > | |
| I2SCodecStream (Board &board) | |
| The board (e.g. an AudioBoard) is ignored: the sound card is used. | |
| template<class Board > | |
| I2SCodecStream (Board *board) | |
| 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 () |
| virtual int | available () override |
| Provides the available audio data. | |
| virtual int | availableForWrite () override |
| Provides the available audio data. | |
| bool | begin () |
| bool | begin () override |
| bool | begin (I2SCodecConfig cfg) |
| virtual bool | begin (I2SCodecConfig cfg) |
| Starts the I2S interface. | |
| bool | begin (MiniAudioConfig info) |
| AudioBoard & | board () |
| Provides the board. | |
| virtual void | clearNotifyAudioChange () |
| Deletes all change notify subscriptions. | |
| I2SCodecConfig | defaultConfig (RxTxMode mode=TX_MODE) |
| I2SCodecConfig | defaultConfig (RxTxMode mode=TX_MODE) |
| Provides the default configuration. | |
| bool | digitalRead (digital_pin_t pin) |
| get value of digital pin | |
| void | digitalWrite (digital_pin_t pin, bool value) |
| set value of digital pin | |
| I2SDriverBase * | driver () |
| Provides the i2s driver. | |
| void | end () |
| Stops the I2S interface. | |
| virtual void | flush () override |
| digital_pin_t | getKey (int pos) |
| Provides the gpio for the indicated key pos. | |
| digital_pin_t | getPinID (PinFunction function) |
| Provides the gpio for the indicated function. | |
| digital_pin_t | getPinID (PinFunction function, int pos) |
| Provides the gpio for the indicated function. | |
| DriverDeviceInfo & | getPins () |
| Provides access to the pin information. | |
| float | getVolume () |
| float | getVolume () |
| legacy: same as volume() | |
| bool | hasBoard () |
| bool | hasBoard () |
| checks if a board has been defined | |
| bool | isNotifyActive () |
| Checks if the automatic AudioInfo update is active. | |
| bool | isNotifyActive () |
| Checks if the automatic AudioInfo update is active. | |
| bool | isPlaying () const |
| Check if playback is currently active. | |
| virtual | operator bool () |
| virtual 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. | |
| void | restartPlayback () |
| Manually restart playback (useful after long delays) | |
| virtual void | setAudioInfo (AudioInfo info) |
| updates the sample rate dynamically | |
| void | setBoard (AudioBoard &board) |
| (re)defines the board | |
| void | setBoard (AudioBoard *board) |
| (re)defines the board | |
| template<class Board > | |
| void | setBoard (Board &board) |
| template<class Board > | |
| void | setBoard (Board *board) |
| bool | setInputVolume (float vol) |
| bool | setInputVolume (float vol) |
| Sets the volume of the microphone (if available) | |
| bool | setMute (bool mute) |
| bool | setMute (bool mute) |
| Mute / unmote. | |
| bool | setMute (bool mute, int line) |
| bool | setMute (bool mute, int line) |
| Mute / unmute of an individual line (codec) | |
| void | setNotifyActive (bool flag) |
| Deactivate/Reactivate automatic AudioInfo updates: (default is active) | |
| void | setNotifyActive (bool flag) |
| Deactivate/Reactivate automatic AudioInfo updates: (default is active) | |
| bool | setPAPower (bool active) |
| bool | setPAPower (bool active) |
| Sets the output of the PA Power Pin. | |
| bool | setVolume (float vol) override |
| define the actual volume in the range of 0.0f to 1.0f | |
| bool | setVolume (float vol) override |
| sets the volume (range 0.0f - 1.0f) | |
| void | setWriteBufferSize (int size) |
| void | setWriteBufferSize (int size) |
| bool | stopDevice () |
| float | volume () override |
| Provides the actual volume (0.0f - 1.0f) | |
| virtual size_t | write (const uint8_t *data, size_t len) |
| Writes the audio data to I2S. | |
| size_t | write (const uint8_t *data, size_t len) override |
| Writes the samples with the volume applied. | |
| virtual size_t | write (uint8_t ch) override |
| virtual void | writeSilence (size_t len) |
| Writes len bytes of silence (=0). | |
Protected Member Functions | |
| bool | begin1 () |
| bool | beginCodec (I2SCodecConfig info) |
| void | doWait () |
| audio_driver_local::Optional< PinsI2S > | getI2SPins () |
| virtual int | not_supported (int out, const char *msg="") |
| void | notifyAudioChange (AudioInfo info) |
| void | notifyAudioChange (AudioInfo info) |
| void | refillReadBuffer () |
| Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read() | |
| void | refillReadBuffer () |
| Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read() | |
| void | setupBuffers (int size=1200) |
| void | setupI2SFunction () |
| if the cfg.i2s_function was not defined we determine the "correct" default value | |
| void | setupI2SPins () |
| We use the board pins if they are available. | |
| sample_bits_t | toCodecBits (int bits) |
| i2s_format_t | toFormat (I2SFormat fmt) |
| samplerate_t | toRate (int rate) |
Static Protected Member Functions | |
| static void | data_callback (ma_device *pDevice, void *pOutput, const void *pInput, ma_uint32 frameCount) |
Protected Attributes | |
| int | _timeout = 10 |
| int | _timeout = 10 |
| Vector< int16_t > | buffer |
| RingBuffer< uint8_t > | buffer_in {0} |
| RingBuffer< uint8_t > | buffer_out {0} |
| std::atomic< int > | buffer_size {0} |
| I2SCodecConfig | cfg |
| CodecConfig | codec_cfg |
| MiniAudioConfig | config |
| ma_device_config | config_ma |
| ma_device | device_ma |
| I2SStream | i2s |
| AudioInfo | info |
| AudioInfo | info |
| bool | is_active = false |
| std::atomic< bool > | is_buffers_setup {false} |
| bool | is_muted = false |
| bool | is_notify_active = true |
| bool | is_notify_active = true |
| std::atomic< bool > | is_playing {false} |
| Vector< AudioInfoSupport * > | notify_vector |
| Vector< AudioInfoSupport * > | notify_vector |
| AudioBoard * | p_board = nullptr |
| std::mutex | read_mtx |
| RingBuffer< uint8_t > | tmp_in {0} |
| RingBuffer< uint8_t > | tmp_in {0} |
| RingBuffer< uint8_t > | tmp_out {0} |
| RingBuffer< uint8_t > | tmp_out {0} |
| float | volume_value = 1.0f |
| int | write_buffer_size = MAX_SINGLE_CHARS |
| int | write_buffer_size = MAX_SINGLE_CHARS |
| std::mutex | write_mtx |
I2SCodecStream on the desktop: output to (and input from) the sound card with miniaudio.
I2S Stream which also sets up a codec chip and i2s.
|
default |
|
inline |
The board (e.g. an AudioBoard) is ignored: the sound card is used.
|
inline |
|
default |
Default Constructor (w/o codec)
|
inline |
Default constructor: for available AudioBoard values check audioboard variables in https://pschatzmann.github.io/arduino-audio-driver/html/group__audio__driver.html Further information can be found in https://github.com/pschatzmann/arduino-audio-driver/wiki.
|
inline |
Provide board via pointer.
|
inlinevirtualinherited |
Adds target to be notified about audio changes.
Reimplemented in CodecNOP, EncodedAudioOutput, EncodedAudioStream, AACDecoderFDK, DecoderBasic, CodecChain, MP3DecoderHelix, MP3DecoderMAD, OggContainerDecoder, RTSPClient< TcpClient, UdpSocket >, Pipeline, and Pipeline::ModifyingStreamAdapter.
|
inlineoverridevirtualinherited |
provides the actual input AudioInfo
Implements AudioInfoSupport.
Reimplemented in JupyterAudioT< T >, MozziStream, TimerCallbackAudioStream, EncodedAudioStream, 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 MP3EncoderShine, PureDataStream, PWMAudioOutput< PWMDriverT >, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, FormatConverterStream, Pipeline, ResampleStream, ResampleStreamT< TInterpolator >, and SupportedRatesStream.
|
inlineoverridevirtual |
Provides the available audio data.
Reimplemented from BaseStream.
|
inlineoverridevirtual |
Provides the available audio data.
Reimplemented from BaseStream.
|
inlinevirtual |
Reimplemented from BaseStream.
|
inlineoverridevirtual |
Reimplemented from BaseStream.
|
inline |
|
inlinevirtual |
Starts the I2S interface.
Reimplemented in AudioBoardStream.
|
inlineinherited |
|
inlineprotected |
|
inlineprotected |
|
inline |
Provides the board.
|
inlinevirtualinherited |
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inlinestaticprotectedinherited |
|
inline |
|
inline |
Provides the default configuration.
|
inline |
get value of digital pin
|
inline |
set value of digital pin
|
inlineprotectedinherited |
|
inline |
Provides the i2s driver.
|
inlinevirtual |
Stops the I2S interface.
Reimplemented from BaseStream.
|
inlineoverridevirtualinherited |
Reimplemented from Print.
Reimplemented in PureDataStream, URLStreamBufferedT< T >, URLStreamBufferedT< ICYStream >, ReformatBaseStream, AudioStreamWrapper, ResampleStream, EncodedAudioStream, BLESerialClientBase, URLStream, BufferedTaskStream, AutomaticGainControlStream, MeasuringStream, QualityAnalysisStream, VolumeStream, AudioEffectStreamT< T >, AudioEffectStream, Equalizer3BandsT< T >, Equalizer3BandsPerChannelT< T >, I2SStream, TimedStream, MemoryStream, RingBufferStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, BufferedStream, FilteredStream< T, TF >, FilteredStream< int16_t, int16_t >, QueueStream< T >, QueueStream< uint8_t >, FadeStream, Pipeline::ModifyingStreamAdapter, SupportedRatesStream, and EqualizerNBands< SampleT, AccT, NUM_TAPS, NUM_BANDS >.
|
inlineprotected |
|
inline |
Provides the gpio for the indicated key pos.
|
inline |
Provides the gpio for the indicated function.
|
inline |
Provides the gpio for the indicated function.
|
inline |
Provides access to the pin information.
|
inline |
|
inline |
|
inline |
checks if a board has been defined
|
inlineinherited |
Check if playback is currently active.
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inlinevirtualinherited |
Reads the audio data.
Reimplemented from AudioStream.
Source to generate silence: just sets the buffer to 0.
|
inlineprotectedinherited |
Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read()
|
inlineprotectedinherited |
Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read()
|
inlinevirtualinherited |
Removes a target in order not to be notified about audio changes.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inlineinherited |
Manually restart playback (useful after long delays)
|
inlinevirtual |
updates the sample rate dynamically
Reimplemented from AudioStream.
|
inline |
(re)defines the board
|
inline |
(re)defines the board
|
inline |
|
inline |
|
inlineinherited |
Deactivate/Reactivate automatic AudioInfo updates: (default is active)
|
inlineinherited |
Deactivate/Reactivate automatic AudioInfo updates: (default is active)
|
inlineprotectedinherited |
|
inlineprotected |
if the cfg.i2s_function was not defined we determine the "correct" default value
|
inlineprotected |
We use the board pins if they are available.
define the actual volume in the range of 0.0f to 1.0f
Reimplemented from VolumeSupport.
sets the volume (range 0.0f - 1.0f)
Reimplemented from VolumeSupport.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineoverridevirtual |
Provides the actual volume (0.0f - 1.0f)
Reimplemented from VolumeSupport.
Writes the audio data to I2S.
Reimplemented from AudioStream.
Writes the samples with the volume applied.
Reimplemented from AudioStream.
Reimplemented in MemoryStream, AudioStreamWrapper, BufferedTaskStream, RingBufferStream, BufferedStream, and URLStream.
|
inlinevirtualinherited |
Writes len bytes of silence (=0).
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |