Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
marchingband committed Feb 1, 2022
1 parent f684331 commit c51c2e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ void handleUpdateMetadata(AsyncWebServerRequest *request, uint8_t *data, size_t
//done
updateMetadata((char *)metadata_json);
free(metadata_json);
// request->send(200, "text/plain", "all done pin config update");
//wav_player_resume();
}
}
Expand Down Expand Up @@ -264,7 +263,6 @@ void handleWav(AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t
//done
close_wav_to_emmc();
add_wav_to_file_system(&w_name[0],w_voice,w_note,w_start_block,total);
// request->send(200, "text/plain", "done upload wav");
//wav_player_resume();
}
}
Expand Down
12 changes: 10 additions & 2 deletions src/wav_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ static const char* TAG = "wav_player";

#define DAMPEN_BITS 1
#define LOG_PERFORMANCE 0
#define LOG_PCM 0

#define MAX_READS_PER_LOOP 4
// #define MAX_READS_PER_LOOP 3
Expand Down Expand Up @@ -498,8 +499,15 @@ void wav_player_task(void* pvParameters)
sample = scale_sample(buf_pointer[bufs[buf].sample_pointer++], bufs[buf].volume);
break;
}
// mix into master
output_buf[i] += (sample >> DAMPEN_BITS);
if(LOG_PCM)
{
log_i("%d %d", bufs[buf].wav_position, sample >> DAMPEN_BITS);
}
else
{
// mix into master
output_buf[i] += (sample >> DAMPEN_BITS);
}
// do fading
if( bufs[buf].fade > 0 && (i % 4 == 0))
{
Expand Down

0 comments on commit c51c2e1

Please sign in to comment.