mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-09 13:07:03 +03:00
catching up (trying to) wiht CSpot
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
#include "InternalAudioSink.h"
|
||||
#include "driver/i2s.h"
|
||||
|
||||
InternalAudioSink::InternalAudioSink()
|
||||
{
|
||||
softwareVolumeControl = true;
|
||||
usign = true;
|
||||
|
||||
i2s_config_t i2s_config = {
|
||||
.mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_DAC_BUILT_IN), // Only TX
|
||||
.sample_rate = (i2s_bits_per_sample_t)44100,
|
||||
.bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT,
|
||||
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
|
||||
.communication_format = (i2s_comm_format_t)I2S_COMM_FORMAT_STAND_I2S,
|
||||
.intr_alloc_flags = 0,//ESP_INTR_FLAG_LEVEL1
|
||||
.dma_buf_count = 6,
|
||||
.dma_buf_len = 512,
|
||||
.use_apll = true,
|
||||
.tx_desc_auto_clear = true, //Auto clear tx descriptor on underflow
|
||||
.fixed_mclk=-1
|
||||
};
|
||||
|
||||
//install and start i2s driver
|
||||
i2s_driver_install((i2s_port_t)0, &i2s_config, 0, NULL);
|
||||
//init DAC
|
||||
i2s_set_dac_mode(I2S_DAC_CHANNEL_BOTH_EN);
|
||||
|
||||
startI2sFeed();
|
||||
}
|
||||
|
||||
InternalAudioSink::~InternalAudioSink()
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user