mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-13 06:57:07 +03:00
Merge branch 'Flexible-internal-buffer-sample-size' into pr/4
This commit is contained in:
@@ -16,8 +16,10 @@ extern struct buffer *streambuf;
|
||||
#define FRAME_BLOCK MAX_SILENCE_FRAMES
|
||||
|
||||
extern u8_t *silencebuf;
|
||||
|
||||
extern u8_t *bt_optr;
|
||||
void hal_bluetooth_init(log_level);
|
||||
|
||||
static int _write_frames(frames_t out_frames, bool silence, s32_t gainL, s32_t gainR,
|
||||
s32_t cross_gain_in, s32_t cross_gain_out, ISAMPLE_T **cross_ptr);
|
||||
#if BTAUDIO
|
||||
@@ -26,9 +28,6 @@ void set_volume(unsigned left, unsigned right) {
|
||||
LOCK;
|
||||
output.gainL = left;
|
||||
output.gainR = right;
|
||||
// TODO
|
||||
output.gainL = FIXED_ONE;
|
||||
output.gainR = FIXED_ONE;
|
||||
UNLOCK;
|
||||
}
|
||||
#endif
|
||||
@@ -70,23 +69,23 @@ void output_close_bt(void) {
|
||||
|
||||
static int _write_frames(frames_t out_frames, bool silence, s32_t gainL, s32_t gainR,
|
||||
s32_t cross_gain_in, s32_t cross_gain_out, ISAMPLE_T **cross_ptr) {
|
||||
|
||||
|
||||
if (!silence ) {
|
||||
DEBUG_LOG_TIMED(200,"Not silence, Writing audio out.");
|
||||
/* TODO need 16 bit fix
|
||||
/* TODO need 16 bit fix
|
||||
|
||||
if (output.fade == FADE_ACTIVE && output.fade_dir == FADE_CROSS && *cross_ptr) {
|
||||
_apply_cross(outputbuf, out_frames, cross_gain_in, cross_gain_out, cross_ptr);
|
||||
}
|
||||
|
||||
|
||||
if (gainL != FIXED_ONE || gainR!= FIXED_ONE) {
|
||||
_apply_gain(outputbuf, out_frames, gainL, gainR);
|
||||
}
|
||||
*/
|
||||
|
||||
#if BYTES_PER_FRAME == 4
|
||||
#if BYTES_PER_FRAME == 4
|
||||
memcpy(bt_optr, outputbuf->readp, out_frames * BYTES_PER_FRAME);
|
||||
#else
|
||||
{
|
||||
{
|
||||
frames_t count = out_frames;
|
||||
s32_t *_iptr = (s32_t*) outputbuf->readp;
|
||||
s16_t *_optr = (s16_t*) bt_optr;
|
||||
@@ -94,8 +93,8 @@ static int _write_frames(frames_t out_frames, bool silence, s32_t gainL, s32_t g
|
||||
*_optr++ = *_iptr++ >> 16;
|
||||
*_optr++ = *_iptr++ >> 16;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
} else {
|
||||
DEBUG_LOG_TIMED(200,"Silence flag true. Writing silence to audio out.");
|
||||
@@ -104,9 +103,8 @@ static int _write_frames(frames_t out_frames, bool silence, s32_t gainL, s32_t g
|
||||
|
||||
memcpy(bt_optr, buf, out_frames * 4);
|
||||
}
|
||||
|
||||
|
||||
bt_optr += out_frames * 4;
|
||||
|
||||
return (int)out_frames;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user