Skip to content

Commit

Permalink
Add sample image and fix compiler warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul1365972 committed Jan 9, 2025
1 parent dc201f3 commit 9701f84
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
3 changes: 0 additions & 3 deletions .vscode/extensions.json

This file was deleted.

12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Spectrogram

Github Pages Deployment
A voice spectrum analyser made using Typescript and Svelte 5.

Try it out here: [Github Pages Deployment](https://paul1365972.github.io/spectrogram/)

## Usage

![Example image showcasing the Spectrogram](assets/sample.png)

All settings are configurable via the menu in the top left corner.

You can also press Space to pause the spectrogram.
Binary file added assets/sample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 0 additions & 6 deletions src/components/Spectrogram.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@
window.addEventListener('mousedown', init)
window.addEventListener('touchstart', init)
window.addEventListener('keydown', handleKeydown)
window.addEventListener('resize', handleResize)
return () => {
window.removeEventListener('mousedown', init)
window.removeEventListener('touchstart', init)
window.removeEventListener('keydown', handleKeydown)
window.removeEventListener('resize', handleResize)
}
})
Expand All @@ -53,10 +51,6 @@
}
}
function handleResize() {
renderer!.handleResize()
}
function render() {
settings = get(settingsStore)
if (!paused) {
Expand Down
3 changes: 2 additions & 1 deletion src/lib/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export const settings = persisted('settings', {
tickVariant: 'preset',
colorMap: 'grayscale',
interpolation: 'nearest',
fftSize: '4096',
noteGuidelines: false,
fftSize: 4096,
smoothingFactor: 0,
lowerFrequency: 45,
upperFrequency: 11000,
Expand Down
2 changes: 1 addition & 1 deletion svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
export default {
// Consult https://svelte.dev/docs#compile-time-svelte-preprocess
// for more information about preprocessors
preprocess: vitePreprocess(),
preprocess: vitePreprocess({ script: true }),
}

0 comments on commit 9701f84

Please sign in to comment.