Skip to content

Commit

Permalink
add previewStartSeconds
Browse files Browse the repository at this point in the history
  • Loading branch information
joshie committed Apr 18, 2019
1 parent f32b2a2 commit 504be0f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bstoaud.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ zip.on('ready', () => {
songDesc.tempo = songInfo.beatsPerMinute;
songDesc.offset = offset;

if (typeof songInfo.previewStartTime === 'number') {
songDesc.previewStartSeconds = songInfo.previewStartTime;
} else {
songDesc.previewStartSeconds = 12;
}

audicaFiles['song.desc'] = JSON.stringify(songDesc,0,2);

audicaFiles['song.mid'].writeUIntBE(Math.round(60000000/songDesc.tempo),41,3);
Expand Down

0 comments on commit 504be0f

Please sign in to comment.