Skip to content

Commit

Permalink
Merge pull request #180 from bible-technology/bug/audio-ch-export
Browse files Browse the repository at this point in the history
audio chapter export verse order issue
  • Loading branch information
vipinpaul authored Oct 23, 2023
2 parents 4e61ef1 + 73c874f commit b4b5ae7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion renderer/src/components/AudioRecorder/core/audioUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,16 @@ async function fetchAndCombineAudio(audioArr, path) {
});
}

function sortingLogic(a, b) {
// expected format : '1_10_1_default.mp3',
return a.split('_')[1] - b.split('_')[1];
}

export async function mergeAudio(audioArr, dirPath, path, book, chapter) {
logger.debug('audioUtils.js', 'In Merge Audio fucntion');
// const audio = new ConcatAudio(window);
return new Promise((resolve) => {
audioArr.sort();
audioArr.sort(sortingLogic);
for (let i = 0; i < audioArr.length; i++) {
audioArr[i] = path.join(dirPath, audioArr[i]);
}
Expand Down

0 comments on commit b4b5ae7

Please sign in to comment.