Skip to content

Commit

Permalink
un-distorted music player
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed Aug 17, 2022
1 parent 9b5486c commit d5eff94
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions applications/music_player/music_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ typedef struct {

typedef struct {
MusicPlayerModel* model;
FuriMutex* model_mutex;
FuriMutex** model_mutex;

FuriMessageQueue* input_queue;

Expand Down Expand Up @@ -256,7 +256,7 @@ MusicPlayer* music_player_alloc() {
instance->model = malloc(sizeof(MusicPlayerModel));
memset(instance->model->duration_history, 0xff, MUSIC_PLAYER_SEMITONE_HISTORY_SIZE);
memset(instance->model->semitone_history, 0xff, MUSIC_PLAYER_SEMITONE_HISTORY_SIZE);
instance->model->volume = 1;
instance->model->volume = 3;

instance->model_mutex = furi_mutex_alloc(FuriMutexTypeNormal);

Expand Down
2 changes: 1 addition & 1 deletion applications/music_player/music_player_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static int32_t music_player_worker_thread_callback(void* context) {
furi_hal_speaker_stop();
furi_hal_speaker_start(frequency, volume);
while(instance->should_work && furi_get_tick() < next_tick) {
volume *= 1.0000000;
volume *= 0.9945679;
furi_hal_speaker_set_volume(volume);
furi_delay_ms(2);
}
Expand Down

0 comments on commit d5eff94

Please sign in to comment.