Skip to content

Commit

Permalink
Merge pull request #73 from ahnlak/audio-fix-1
Browse files Browse the repository at this point in the history
Added (back) the missing playing() function
  • Loading branch information
Gadgetoid authored Jan 26, 2022
2 parents 266c7d9 + 36f65c4 commit e11c61f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libraries/audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ namespace picosystem {
return (_ms > _duration + _voice.release + _voice.reverb) ? -1 : _ms;
}

bool playing() {
return position() != -1;
}

uint8_t audio_sample(uint32_t ms) {
// calculate full duration including release and reverb
uint32_t full_duration = _duration + _voice.release + _voice.reverb;
Expand Down

0 comments on commit e11c61f

Please sign in to comment.