From df35337e898fd1f8dc2438db48dd24788c1be901 Mon Sep 17 00:00:00 2001 From: HerozDotExe Date: Sat, 16 Aug 2025 00:03:03 +0200 Subject: [PATCH 1/5] docs: add installations instructions --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index edc5309..764338e 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,13 @@ A soundboard with direct access to [myinstants](https://www.myinstants.com)' library. -## Recommended IDE Setup +## Installation -- [VSCode](https://code.visualstudio.com/) + [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) + [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) +To use throughmic, you need to install [vbcable](https://vb-audio.com/Cable/), then download the latest version of throughmic in the releases tabs. +Once done you need to select in the app the vbcable device. You should pick `CABLE Input (VB-Audio Virtual Cable)` with audiooutput selected. If you can't find it, check that you installed correctly VBCable. +Then you need to go to the app you want to use this with, for example discord, and you need to change the micro to `CABLE Output (VB-Audio Virtual Cable)`. +Finally to be able to speak and use the soundboard you need to go to windows sound settings and enable "listen to this device" to send your mic's output to `CABLE Input (VB-Audio Virtual Cable)`. +You should now be able to play sounds. ## Project Setup From d878ee57376e505a7b7c7e6cf84547c2f22e63ed Mon Sep 17 00:00:00 2001 From: HerozDotExe Date: Sat, 16 Aug 2025 00:04:25 +0200 Subject: [PATCH 2/5] docs: add informations on myinstants window --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 764338e..fcbf6d4 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ Then you need to go to the app you want to use this with, for example discord, a Finally to be able to speak and use the soundboard you need to go to windows sound settings and enable "listen to this device" to send your mic's output to `CABLE Input (VB-Audio Virtual Cable)`. You should now be able to play sounds. +You don't need to use the myinstants windows, it's for developpement purposes and will probably be removed later. + ## Project Setup ### Install From 2af92f8e1683a2117fe9c5b06c3ea8335381db03 Mon Sep 17 00:00:00 2001 From: HerozDotExe Date: Sat, 16 Aug 2025 10:52:50 +0200 Subject: [PATCH 3/5] refactor: divides logic in components --- src/renderer/src/App.svelte | 187 +----------------- src/renderer/src/lib/components/Footer.svelte | 95 +++++++++ src/renderer/src/lib/components/Header.svelte | 30 +++ .../src/lib/components/Results.svelte | 61 ++++++ src/renderer/src/lib/states.svelte.ts | 14 ++ 5 files changed, 206 insertions(+), 181 deletions(-) create mode 100644 src/renderer/src/lib/components/Footer.svelte create mode 100644 src/renderer/src/lib/components/Header.svelte create mode 100644 src/renderer/src/lib/components/Results.svelte create mode 100644 src/renderer/src/lib/states.svelte.ts diff --git a/src/renderer/src/App.svelte b/src/renderer/src/App.svelte index 422691b..e322fb1 100644 --- a/src/renderer/src/App.svelte +++ b/src/renderer/src/App.svelte @@ -1,186 +1,11 @@ -
- -
+
-
- - - - {#each sounds as sound (sound)} - - - - - - - - - - {/each} - - -
+ -
- - - - - Select audio device - Usually you should select "CABLE Input" - - - {#each kinds as kind (kind)} -
- - -
- {/each} -
- - - {triggerContent} - - - - Devices - {#each devices as device (`${device.deviceId}`)} - - {device.label} - - {/each} - - - - - - -
-
-
+
diff --git a/src/renderer/src/lib/components/Footer.svelte b/src/renderer/src/lib/components/Footer.svelte new file mode 100644 index 0000000..c1b52ca --- /dev/null +++ b/src/renderer/src/lib/components/Footer.svelte @@ -0,0 +1,95 @@ + + +
+ + + + + Select audio device + Usually you should select "CABLE Input" + + + {#each kinds as kind (kind)} +
+ + +
+ {/each} +
+ + + {triggerContent} + + + + Devices + {#each devices as device (`${device.deviceId}`)} + + {device.label} + + {/each} + + + + + + +
+
+
diff --git a/src/renderer/src/lib/components/Header.svelte b/src/renderer/src/lib/components/Header.svelte new file mode 100644 index 0000000..794285b --- /dev/null +++ b/src/renderer/src/lib/components/Header.svelte @@ -0,0 +1,30 @@ + + +
+ +
diff --git a/src/renderer/src/lib/components/Results.svelte b/src/renderer/src/lib/components/Results.svelte new file mode 100644 index 0000000..8807bc0 --- /dev/null +++ b/src/renderer/src/lib/components/Results.svelte @@ -0,0 +1,61 @@ + + +
+ + + + {#each states.sounds as sound (sound)} + + + + + + + + + + {/each} + + +
diff --git a/src/renderer/src/lib/states.svelte.ts b/src/renderer/src/lib/states.svelte.ts new file mode 100644 index 0000000..cb3cc07 --- /dev/null +++ b/src/renderer/src/lib/states.svelte.ts @@ -0,0 +1,14 @@ +type Sound = { + name: string + // author: string + // favorited: number + // viewed: number + link: string + src: string +} + +type States = { sounds: Sound[] } + +export const states: States = $state({ + sounds: [] +}) From 1de7e5cccea6984f33349d11a461fa5a73659740 Mon Sep 17 00:00:00 2001 From: HerozDotExe Date: Sun, 21 Sep 2025 19:23:56 +0200 Subject: [PATCH 4/5] feat: allow to play sound twice on dfferent device --- src/renderer/src/lib/audio.ts | 10 +- .../src/lib/components/DevicesSelector.svelte | 130 ++++++++++++++++++ src/renderer/src/lib/components/Footer.svelte | 94 +------------ .../src/lib/components/Results.svelte | 8 +- 4 files changed, 147 insertions(+), 95 deletions(-) create mode 100644 src/renderer/src/lib/components/DevicesSelector.svelte diff --git a/src/renderer/src/lib/audio.ts b/src/renderer/src/lib/audio.ts index da82302..67b4094 100644 --- a/src/renderer/src/lib/audio.ts +++ b/src/renderer/src/lib/audio.ts @@ -1,21 +1,29 @@ export class _Audio { src: string audio: HTMLAudioElement + secondaryAudio: HTMLAudioElement constructor(src: string) { this.src = src this.audio = new Audio(src) + this.secondaryAudio = new Audio(src) } play() { this.audio.play() + this.secondaryAudio.play() } stop() { this.audio.pause() + this.secondaryAudio.pause() this.audio.remove() + this.secondaryAudio.remove() } - setOuputDevice(id: string) { + setMainOuputDevice(id: string) { this.audio.setSinkId(id) } + setSecondaryOuputDevice(id: string) { + this.secondaryAudio.setSinkId(id) + } } diff --git a/src/renderer/src/lib/components/DevicesSelector.svelte b/src/renderer/src/lib/components/DevicesSelector.svelte new file mode 100644 index 0000000..238dd97 --- /dev/null +++ b/src/renderer/src/lib/components/DevicesSelector.svelte @@ -0,0 +1,130 @@ + + + + + + + Select main audio device + Usually you should select "CABLE Input" + + + {#each kinds as kind (kind)} +
+ + +
+ {/each} +
+ + + {mainTriggerContent} + + + + Devices + {#each devices as device (`${device.deviceId}`)} + + {device.label} + + {/each} + + + +
+ + Select secondary audio device + Usually you should your headset + + + {#each kinds as secondaryKind (secondaryKind)} +
+ + +
+ {/each} +
+ + + {secondaryTriggerContent} + + + + Devices + {#each devices as device (`${device.deviceId}`)} + + {device.label} + + {/each} + + + + + + +
+
diff --git a/src/renderer/src/lib/components/Footer.svelte b/src/renderer/src/lib/components/Footer.svelte index c1b52ca..0b81305 100644 --- a/src/renderer/src/lib/components/Footer.svelte +++ b/src/renderer/src/lib/components/Footer.svelte @@ -1,95 +1,7 @@ -
- - - - - Select audio device - Usually you should select "CABLE Input" - - - {#each kinds as kind (kind)} -
- - -
- {/each} -
- - - {triggerContent} - - - - Devices - {#each devices as device (`${device.deviceId}`)} - - {device.label} - - {/each} - - - - - - -
-
+
diff --git a/src/renderer/src/lib/components/Results.svelte b/src/renderer/src/lib/components/Results.svelte index 8807bc0..4dcf106 100644 --- a/src/renderer/src/lib/components/Results.svelte +++ b/src/renderer/src/lib/components/Results.svelte @@ -7,17 +7,19 @@ let sound: _Audio function play(src: string): void { - if (!localStorage.getItem('output_device_id')) { + if (!localStorage.getItem('output_main_device_id')) { return alert('Please select an audio device to ouput sounds.') } if (sound) { sound.stop() } sound = new _Audio(src) - sound.setOuputDevice(localStorage.getItem('output_device_id')) + sound.setMainOuputDevice(localStorage.getItem('output_main_device_id')) + if (localStorage.getItem('output_secondary_device_id')) { + sound.setSecondaryOuputDevice(localStorage.getItem('output_secondary_device_id')) + } sound.play() } - onMount(async () => { states.sounds = await window.api.search() }) From 17f6d002a0cdfe7320340c7f1fa1b61649c226c9 Mon Sep 17 00:00:00 2001 From: HerozDotExe Date: Sun, 21 Sep 2025 19:27:09 +0200 Subject: [PATCH 5/5] chroe: random vscode settings.json tweak --- .vscode/settings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e603f77..c458adf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,13 +3,13 @@ "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[javascript]": { - "editor.defaultFormatter": "vscode.typescript-language-features" + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[svelte]": { - "editor.defaultFormatter": "svelte.svelte-vscode" + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "svelte.enable-ts-plugin": true, "eslint.validate": [