Hey everyone,
For my current project, I’m using a DY-HV20T series sound module for playing audio WAV files. I use an SD card to store various audio files for playback. I’m also using the "dyplayer-main" library provided by SnijderC: GitHub - SnijderC/dyplayer: Abstracton for DY-XXXX mp3 player modules over UART..
There are different kinds of manuals, such as this one:
In my project, I use the library’s UART commands for playback. So far, "normal" playback of different sound files works as expected.
I have the following problem: I want to play sound file A, and after it finishes, I want to loop sound file B indefinitely until another "new" file, like sound file C, is requested for playback.
I created a function for this
:
void checkAndUpdateTrack(DY::Player& playerSoftware, char sf_current[], char newAudio[]) { // put input and check for volume controlFrau
// Compare the two strings
if (strcmp(sf_current, newAudio) == 0) {
// If they are the same
} else {
// If they are different
// Copy newAudio content into sf_current
strcpy(sf_current, newAudio);
// Call the method on the player software object
playerSoftware.playSpecifiedDevicePath(DY::Device::Sd, newAudio);
}
}
this function uses the defined player for playback and checks if the new input is different form the previous one, if not it plays back the current one and if so it playbacks the new one.
for my problem i could define how long the duration of song a is and start a timer and the after the timer has reached the songduration i can tell the player to loop song b but with this i always have to start a timer.
is there a more elegant way?
i could also create a new soundfile via e.g. audacity that only plays file a once and then i manually loop file b.
what do the following functions do in the library "dyplayer-main" in file "dyplayer.h"
- interludeSpecified
- interludeSpecifiedDevicePath
- combinationPlay
I am from germany and my english is not that good
so maybe i just don't get what the interlude or combination play means.