Developer World
Spresense Arduino Library v3.3.0-b2e6327
OutputMixer Class Reference

OutputMixer Class Definitions. More...

#include <OutputMixer.h>

Public Member Functions

err_t begin (void)
 Initialize the OutputMixer. More...
 
err_t end (void)
 Finalize the OutputMixer. More...
 
err_t create (void)
 Creation of the OutputMixer. More...
 
err_t create (AudioAttentionCb attcb)
 Creation of the OutputMixer. More...
 
err_t activate (AsOutputMixerHandle handle, OutputMixerCallback omcb)
 Activate the OutputMixer. More...
 
err_t activate (AsOutputMixerHandle handle, uint8_t output_device, OutputMixerCallback omcb)
 Activate the OutputMixer with specify output device. More...
 
err_t sendData (AsOutputMixerHandle handle, PcmProcDoneCallback pcmdone_cb, AsPcmDataParam pcm)
 Send PCM data via OutputMixer. More...
 
err_t deactivate (AsOutputMixerHandle handle)
 Deactivate the OutputMixer. More...
 
err_t activateBaseband (void)
 Activate Audio Hw. More...
 
err_t deactivateBaseband (void)
 Deactivate Audio Hw. More...
 
err_t setVolume (int master, int player0, int player1)
 Set speaker out volume. More...
 
bool setRenderingClkMode (uint8_t clk_mode)
 Set Rendering clock mode. More...
 

Static Public Member Functions

static OutputMixergetInstance ()
 Get instance of MediaRecorder for singleton.
 

Detailed Description

OutputMixer Class Definitions.

Member Function Documentation

◆ begin()

err_t OutputMixer::begin ( void  )
inline

Initialize the OutputMixer.

This function activates Audio HW.

◆ end()

err_t OutputMixer::end ( void  )
inline

Finalize the OutputMixer.

This function deactivates output mixer system.

◆ create() [1/2]

err_t OutputMixer::create ( void  )

Creation of the OutputMixer.

This function is called only once when using the OutputMixer. In this function, create objcets for audio data mixing and rendering.

◆ create() [2/2]

err_t OutputMixer::create ( AudioAttentionCb  attcb)

Creation of the OutputMixer.

This function can set callback funtion which receive attention notify.

◆ activate() [1/2]

err_t OutputMixer::activate ( AsOutputMixerHandle  handle,
OutputMixerCallback  omcb 
)

Activate the OutputMixer.

This function activates output mixer system. The result of APIs will be returnd by callback function which is specified by this function. Output device is speaker output fixed.

Parameters
handleSelect output mixer handle. OutputMixer0 or OutputMixer1
omcbSepcify callback function which is called to notify API results.

◆ activate() [2/2]

err_t OutputMixer::activate ( AsOutputMixerHandle  handle,
uint8_t  output_device,
OutputMixerCallback  omcb 
)

Activate the OutputMixer with specify output device.

This function activates output mixer system. The result of APIs will be returnd by callback function which is specified by this function. This I/F can specify output device as speaker or i2s.

Parameters
handleSelect output mixer handle. OutputMixer0 or OutputMixer1
output_deviceSelect output device. HPOutputDevice or I2SOutputDevice
omcbSepcify callback function which is called to notify API results.

◆ sendData()

err_t OutputMixer::sendData ( AsOutputMixerHandle  handle,
PcmProcDoneCallback  pcmdone_cb,
AsPcmDataParam  pcm 
)

Send PCM data via OutputMixer.

This function send PCM data. According to "pcm" paramters, start sending PCM data. When send complete, callback function "pcmdome_cb" will be called.

Parameters
handleSelect output mixer handle. OutputMixer0 or OutputMixer1
pcmdone_cbCallback function which will be called when send complete
pcmPCM data parameters

◆ deactivate()

err_t OutputMixer::deactivate ( AsOutputMixerHandle  handle)

Deactivate the OutputMixer.

This function deactivates output mixer system.

Parameters
handleSelect output mixer handle. OutputMixer0 or OutputMixer1

◆ activateBaseband()

err_t OutputMixer::activateBaseband ( void  )

Activate Audio Hw.

This function activates Audio HW. You must call this API to sound.

◆ deactivateBaseband()

err_t OutputMixer::deactivateBaseband ( void  )

Deactivate Audio Hw.

This function deactivates output mixer system.

◆ setVolume()

err_t OutputMixer::setVolume ( int  master,
int  player0,
int  player1 
)

Set speaker out volume.

This function set volume. You should activate baseband before this API call.

Parameters
masterMaster volume. -1020(-102db) - 120(12db)
player0Player0 volume. -1020(-102db) - 120(12db)
player1Plyaer1 volume. -1020(-102db) - 120(12db)

◆ setRenderingClkMode()

bool OutputMixer::setRenderingClkMode ( uint8_t  clk_mode)

Set Rendering clock mode.

This API set internal audio renderer clock mode to Normal(48kHz) or HiReso(192kHz). Default on boot is Normal, if you set HiReso, call this API with HiReso set.

Parameters
clk_modeSet clock mode. OUTPUTMIXER_RNDCLK_NORMAL, OUTPUTMIXER_RNDCLK_HIRESO

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