Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/hcr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,15 @@ void HCRVocalizer::PlayWAV(int ch,String file) {
}
}

void HCRVocalizer::PlayRandomWAV(int ch,String file1, String file2) {
if (millis() > lastPlayWAV) {
lastPlayWAV = millis() + 5000;
char channel[] = "VAB";
String msg = "C" + ToString((char) channel[ch]) + file1 + "C" + file2 + ",QP" + ToString((char) channel[ch]);
sendCommand(msg);
}
}

void HCRVocalizer::StopWAV(int ch) {
char channel[] = "VAB";
String msg = "PS" + ToString((char) channel[ch]) + ",QP" + ToString((char) channel[ch]);
Expand Down
9 changes: 9 additions & 0 deletions src/hcr.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,15 @@ class HCRVocalizer
*/
void PlayWAV(int v,String file);

/**
* @brief Plays a WAV file by file name
*
* @param v the channel (CH_A|CH_B)
* @param file1 the file name prefix (e.g. "0000")
* @param file2 the file name prefix (e.g. "0001")
*/
void PlayRandomWAV(int v,String file1, String file2);

/**
* @brief Stops the WAV playing on the specified channel
*
Expand Down