MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / timestampToSample

Function timestampToSample

plugins/wasi_nn/wasinn_whisper.cpp:24–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22
23namespace {
24int timestampToSample(int64_t T, int NSamples, int WhisperSampleRate) {
25 return std::max(0, std::min(static_cast<int>(NSamples) - 1,
26 static_cast<int>((T * WhisperSampleRate) / 100)));
27}
28std::string toTimestamp(int64_t T, bool Comma) {
29 int64_t Msec = T * 10;
30 int64_t Hr = Msec / (1000 * 60 * 60);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected