Skip to content
DeepForgeby svx
All problems
EasyNLPnlp-191

Speech Token Frame Rate

Problem

Return how many frames per second a speech tokenizer produces: sample_rate / hop_length, where hop_length is the frame hop in samples.

Hint

A smaller hop length gives a higher frame rate.

Test cases

case 1
in: [16000,160]
expected: 100
case 2
in: [16000,320]
expected: 50
case 3
in: [8000,80]
expected: 100
case 4
in: [22050,256]
expected: 86.1328125
Starter codePython
def speech_token_frame_rate(sample_rate, hop_length):
    # Your code here
    pass

4 test cases · run your code against them in the editor