Skip to content

Commit

Permalink
codal_app/microbithal_audio: Add microbit_hal_audio_is_playing() func.
Browse files Browse the repository at this point in the history
Signed-off-by: Damien George <[email protected]>
  • Loading branch information
dpgeorge committed Sep 9, 2024
1 parent 305c396 commit d0080bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/codal_app/microbithal.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ int microbit_hal_log_data(const char *key, const char *value);
void microbit_hal_audio_select_pin(int pin);
void microbit_hal_audio_select_speaker(bool enable);
void microbit_hal_audio_set_volume(int value);
bool microbit_hal_audio_is_playing(void);
bool microbit_hal_audio_is_expression_active(void);
void microbit_hal_audio_play_expression(const char *expr);
void microbit_hal_audio_stop_expression(void);
Expand Down
4 changes: 4 additions & 0 deletions src/codal_app/microbithal_audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ void microbit_hal_sound_synth_callback(int event) {
}
}

bool microbit_hal_audio_is_playing(void) {
return uBit.audio.isPlaying();
}

bool microbit_hal_audio_is_expression_active(void) {
return sound_synth_active_count > 0;
}
Expand Down

0 comments on commit d0080bc

Please sign in to comment.