mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
server: update to set 256 points by default
This commit is contained in:
@@ -4,7 +4,7 @@ import av
|
||||
import numpy as np
|
||||
|
||||
|
||||
def get_audio_waveform(path: Path | str, segments_count: int = 1000) -> list[int]:
|
||||
def get_audio_waveform(path: Path | str, segments_count: int = 256) -> list[int]:
|
||||
if isinstance(path, Path):
|
||||
path = path.as_posix()
|
||||
|
||||
@@ -67,7 +67,7 @@ if __name__ == "__main__":
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("path", type=Path)
|
||||
parser.add_argument("--segments-count", type=int, default=1000)
|
||||
parser.add_argument("--segments-count", type=int, default=256)
|
||||
args = parser.parse_args()
|
||||
|
||||
print(get_audio_waveform(args.path, args.segments_count))
|
||||
|
||||
@@ -121,7 +121,7 @@ class Transcript(BaseModel):
|
||||
# move temporary file to final location
|
||||
shutil.move(tmp.name, fn.as_posix())
|
||||
|
||||
def convert_audio_to_waveform(self, segments_count=1000):
|
||||
def convert_audio_to_waveform(self, segments_count=256):
|
||||
fn = self.audio_waveform_filename
|
||||
if fn.exists():
|
||||
return
|
||||
|
||||
@@ -104,4 +104,4 @@ async def test_transcript_audio_download_waveform(fake_transcript):
|
||||
assert response.status_code == 200
|
||||
assert response.headers["content-type"] == "application/json"
|
||||
assert isinstance(response.json()["data"], list)
|
||||
assert len(response.json()["data"]) == 1000
|
||||
assert len(response.json()["data"]) == 256
|
||||
|
||||
Reference in New Issue
Block a user