Skip to content

Commit

Permalink
Merge pull request #4 from Om-Thorat/master
Browse files Browse the repository at this point in the history
Adds a convert button🔲
  • Loading branch information
MatejMecka authored Jul 18, 2023
2 parents 766c267 + eff1de4 commit 18a7f56
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 15 additions & 3 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
let whisper_text;
let whisper_captions;
let stored_model;
let convert_button:HTMLButtonElement;
let threads = 16;
// Functions
Expand All @@ -36,7 +37,18 @@
useWhisper(audio_data, language);
}
$: audio_data, extract_subs();
function activateButton(){
if (audio_data != undefined && language != undefined && stored_model != false){
convert_button.classList.replace("btn-disabled","btn-sucess");
}
else{
//nothing
}
}
$: audio_data,activateButton()
$: stored_model,activateButton()
$: language,activateButton()
function handleSubs(e) {
SUB_DATA = window.SUB_DATA;
Expand Down Expand Up @@ -91,15 +103,15 @@
Threads in use: {threads}
</div>
</div>

<button class="btn btn-disabled w-1/2" bind:this={convert_button} on:click={extract_subs}>Convert</button>
{#if whisper_captions == 0 && window.SUB_DATA.length == 0}
<!-- arbitary values currently you can update this with the real variables recieved from svelte store -->
<!-- <div class="radial-progress" style="--value:70;">70%</div> -->
<p>Loading... Depending on the audio length it may take time</p>
{whisper_captions}
{:else if whisper_captions == 0 && window.SUB_DATA.length != 0}
<h5>You will see progress in realtime</h5>
{#each SUB_DATA as sub}
{#each SUB_DATA as sub}
<p>{sub}</p>
{/each}
<!-- <p>Full Array: {SUB_DATA}</p> -->
Expand Down
2 changes: 1 addition & 1 deletion src/lib/audio/ExtractAudioTracks.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
</script>

{#if started}
<div class="radial-progress" bind:this={ProgressMeter} style="--value:0">{progress}%</div>
<div class="radial-progress" bind:this={ProgressMeter} style="--value:0">{progress.toFixed(2)}%</div>
{/if}

{#if show_audio}
Expand Down

0 comments on commit 18a7f56

Please sign in to comment.