Skip to content

Commit

Permalink
Print information about VGM song length in seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
rejunity committed Nov 7, 2023
1 parent 11d4fea commit 33d58a6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ def get_sample(dut, channel):
# return 0
print(vgm_filename, "->", wave_file)
print(f"VGM playback rate: {playback_rate}, clock: {clock_rate}, frames: {len(music)}" )
print(f"VGM length: {len(music)/playback_rate:.2f} sec" )
print(f"This script will record {max_time if max_time > 0 else len(music)/playback_rate:.2f} sec" )


WRITE_ENABLED = 0b11111_01_0 # SEL = 1 :: no clock div ; /WE = 0 :: writes enabled
WRITE_DISABLED = 0b11111_01_1 # SEL = 1 :: no clock div ; /WE = 1 :: writes disabled
Expand Down Expand Up @@ -217,10 +220,6 @@ def get_sample(dut, channel):
dut.rst_n.value = 1
print_chip_state(dut)

dut._log.info("record " + str(max_time) + " sec")
# music = music[(60+45)*50:-1]
# music = music[:300]

n = 0
samples = [[] for ch in wave_file]
for frame in music:
Expand Down

0 comments on commit 33d58a6

Please sign in to comment.