feat: make sound file addresses relative

This commit is contained in:
MAZE 2025-07-19 22:07:06 +03:30
parent 1e24cbc6eb
commit 81d9d7ca03
10 changed files with 114 additions and 89 deletions

View file

@ -21,6 +21,8 @@ import { PiBirdFill, PiDogBold } from 'react-icons/pi/index';
import type { Category } from '../types'; import type { Category } from '../types';
import { getAssetPath } from '@/helpers/path';
export const animals: Category = { export const animals: Category = {
icon: <FaDog />, icon: <FaDog />,
id: 'animals', id: 'animals',
@ -29,97 +31,97 @@ export const animals: Category = {
icon: <PiBirdFill />, icon: <PiBirdFill />,
id: 'birds', id: 'birds',
label: 'Birds', label: 'Birds',
src: '/sounds/animals/birds.mp3', src: getAssetPath('/sounds/animals/birds.mp3'),
}, },
{ {
icon: <GiSeagull />, icon: <GiSeagull />,
id: 'seagulls', id: 'seagulls',
label: 'Seagulls', label: 'Seagulls',
src: '/sounds/animals/seagulls.mp3', src: getAssetPath('/sounds/animals/seagulls.mp3'),
}, },
{ {
icon: <GiCricket />, icon: <GiCricket />,
id: 'crickets', id: 'crickets',
label: 'Crickets', label: 'Crickets',
src: '/sounds/animals/crickets.mp3', src: getAssetPath('/sounds/animals/crickets.mp3'),
}, },
{ {
icon: <GiWolfHead />, icon: <GiWolfHead />,
id: 'wolf', id: 'wolf',
label: 'Wolf', label: 'Wolf',
src: '/sounds/animals/wolf.mp3', src: getAssetPath('/sounds/animals/wolf.mp3'),
}, },
{ {
icon: <GiOwl />, icon: <GiOwl />,
id: 'owl', id: 'owl',
label: 'Owl', label: 'Owl',
src: '/sounds/animals/owl.mp3', src: getAssetPath('/sounds/animals/owl.mp3'),
}, },
{ {
icon: <FaFrog />, icon: <FaFrog />,
id: 'frog', id: 'frog',
label: 'Frog', label: 'Frog',
src: '/sounds/animals/frog.mp3', src: getAssetPath('/sounds/animals/frog.mp3'),
}, },
{ {
icon: <PiDogBold />, icon: <PiDogBold />,
id: 'dog-barking', id: 'dog-barking',
label: 'Dog Barking', label: 'Dog Barking',
src: '/sounds/animals/dog-barking.mp3', src: getAssetPath('/sounds/animals/dog-barking.mp3'),
}, },
{ {
icon: <FaHorseHead />, icon: <FaHorseHead />,
id: 'horse-gallop', id: 'horse-gallop',
label: 'Horse Gallop', label: 'Horse Gallop',
src: '/sounds/animals/horse-gallop.mp3', src: getAssetPath('/sounds/animals/horse-gallop.mp3'),
}, },
{ {
icon: <FaCat />, icon: <FaCat />,
id: 'cat-purring', id: 'cat-purring',
label: 'Cat Purring', label: 'Cat Purring',
src: '/sounds/animals/cat-purring.mp3', src: getAssetPath('/sounds/animals/cat-purring.mp3'),
}, },
{ {
icon: <FaCrow />, icon: <FaCrow />,
id: 'crows', id: 'crows',
label: 'Crows', label: 'Crows',
src: '/sounds/animals/crows.mp3', src: getAssetPath('/sounds/animals/crows.mp3'),
}, },
{ {
icon: <GiWhaleTail />, icon: <GiWhaleTail />,
id: 'whale', id: 'whale',
label: 'Whale', label: 'Whale',
src: '/sounds/animals/whale.mp3', src: getAssetPath('/sounds/animals/whale.mp3'),
}, },
{ {
icon: <GiTreeBeehive />, icon: <GiTreeBeehive />,
id: 'beehive', id: 'beehive',
label: 'Beehive', label: 'Beehive',
src: '/sounds/animals/beehive.mp3', src: getAssetPath('/sounds/animals/beehive.mp3'),
}, },
{ {
icon: <GiEgyptianBird />, icon: <GiEgyptianBird />,
id: 'woodpecker', id: 'woodpecker',
label: 'Woodpecker', label: 'Woodpecker',
src: '/sounds/animals/woodpecker.mp3', src: getAssetPath('/sounds/animals/woodpecker.mp3'),
}, },
{ {
icon: <GiChicken />, icon: <GiChicken />,
id: 'chickens', id: 'chickens',
label: 'Chickens', label: 'Chickens',
src: '/sounds/animals/chickens.mp3', src: getAssetPath('/sounds/animals/chickens.mp3'),
}, },
{ {
icon: <GiCow />, icon: <GiCow />,
id: 'cows', id: 'cows',
label: 'Cows', label: 'Cows',
src: '/sounds/animals/cows.mp3', src: getAssetPath('/sounds/animals/cows.mp3'),
}, },
{ {
icon: <GiSheep />, icon: <GiSheep />,
id: 'sheep', id: 'sheep',
label: 'Sheep', label: 'Sheep',
src: '/sounds/animals/sheep.mp3', src: getAssetPath('/sounds/animals/sheep.mp3'),
}, },
], ],
title: 'Animals', title: 'Animals',

View file

@ -3,6 +3,8 @@ import { BsSoundwave } from 'react-icons/bs/index';
import type { Category } from '../types'; import type { Category } from '../types';
import { getAssetPath } from '@/helpers/path';
export const binaural: Category = { export const binaural: Category = {
icon: <TbWaveSine />, icon: <TbWaveSine />,
id: 'binaural', id: 'binaural',
@ -11,31 +13,31 @@ export const binaural: Category = {
icon: <BsSoundwave />, icon: <BsSoundwave />,
id: 'binaural-delta', id: 'binaural-delta',
label: 'Delta', label: 'Delta',
src: '/sounds/binaural/binaural-delta.wav', src: getAssetPath('/sounds/binaural/binaural-delta.wav'),
}, },
{ {
icon: <BsSoundwave />, icon: <BsSoundwave />,
id: 'binaural-theta', id: 'binaural-theta',
label: 'Theta', label: 'Theta',
src: '/sounds/binaural/binaural-theta.wav', src: getAssetPath('/sounds/binaural/binaural-theta.wav'),
}, },
{ {
icon: <BsSoundwave />, icon: <BsSoundwave />,
id: 'binaural-alpha', id: 'binaural-alpha',
label: 'Alpha', label: 'Alpha',
src: '/sounds/binaural/binaural-alpha.wav', src: getAssetPath('/sounds/binaural/binaural-alpha.wav'),
}, },
{ {
icon: <BsSoundwave />, icon: <BsSoundwave />,
id: 'binaural-beta', id: 'binaural-beta',
label: 'Beta', label: 'Beta',
src: '/sounds/binaural/binaural-beta.wav', src: getAssetPath('/sounds/binaural/binaural-beta.wav'),
}, },
{ {
icon: <BsSoundwave />, icon: <BsSoundwave />,
id: 'binaural-gamma', id: 'binaural-gamma',
label: 'Gamma', label: 'Gamma',
src: '/sounds/binaural/binaural-gamma.wav', src: getAssetPath('/sounds/binaural/binaural-gamma.wav'),
}, },
], ],
title: 'Binaural Beats', title: 'Binaural Beats',

View file

@ -11,6 +11,8 @@ import {
import type { Category } from '../types'; import type { Category } from '../types';
import { getAssetPath } from '@/helpers/path';
export const nature: Category = { export const nature: Category = {
icon: <BiSolidTree />, icon: <BiSolidTree />,
id: 'nature', id: 'nature',
@ -19,73 +21,73 @@ export const nature: Category = {
icon: <BiWater />, icon: <BiWater />,
id: 'river', id: 'river',
label: 'River', label: 'River',
src: '/sounds/nature/river.mp3', src: getAssetPath('/sounds/nature/river.mp3'),
}, },
{ {
icon: <FaWater />, icon: <FaWater />,
id: 'waves', id: 'waves',
label: 'Waves', label: 'Waves',
src: '/sounds/nature/waves.mp3', src: getAssetPath('/sounds/nature/waves.mp3'),
}, },
{ {
icon: <BsFire />, icon: <BsFire />,
id: 'campfire', id: 'campfire',
label: 'Campfire', label: 'Campfire',
src: '/sounds/nature/campfire.mp3', src: getAssetPath('/sounds/nature/campfire.mp3'),
}, },
{ {
icon: <FaWind />, icon: <FaWind />,
id: 'wind', id: 'wind',
label: 'Wind', label: 'Wind',
src: '/sounds/nature/wind.mp3', src: getAssetPath('/sounds/nature/wind.mp3'),
}, },
{ {
icon: <FaWind />, icon: <FaWind />,
id: 'howling-wind', id: 'howling-wind',
label: 'Howling Wind', label: 'Howling Wind',
src: '/sounds/nature/howling-wind.mp3', src: getAssetPath('/sounds/nature/howling-wind.mp3'),
}, },
{ {
icon: <BiSolidTree />, icon: <BiSolidTree />,
id: 'wind-in-trees', id: 'wind-in-trees',
label: 'Wind in Trees', label: 'Wind in Trees',
src: '/sounds/nature/wind-in-trees.mp3', src: getAssetPath('/sounds/nature/wind-in-trees.mp3'),
}, },
{ {
icon: <GiWaterfall />, icon: <GiWaterfall />,
id: 'waterfall', id: 'waterfall',
label: 'Waterfall', label: 'Waterfall',
src: '/sounds/nature/waterfall.mp3', src: getAssetPath('/sounds/nature/waterfall.mp3'),
}, },
{ {
icon: <FaRegSnowflake />, icon: <FaRegSnowflake />,
id: 'walk-in-snow', id: 'walk-in-snow',
label: 'Walk in Snow', label: 'Walk in Snow',
src: '/sounds/nature/walk-in-snow.mp3', src: getAssetPath('/sounds/nature/walk-in-snow.mp3'),
}, },
{ {
icon: <FaLeaf />, icon: <FaLeaf />,
id: 'walk-on-leaves', id: 'walk-on-leaves',
label: 'Walk on Leaves', label: 'Walk on Leaves',
src: '/sounds/nature/walk-on-leaves.mp3', src: getAssetPath('/sounds/nature/walk-on-leaves.mp3'),
}, },
{ {
icon: <GiStonePile />, icon: <GiStonePile />,
id: 'walk-on-gravel', id: 'walk-on-gravel',
label: 'Walk on Gravel', label: 'Walk on Gravel',
src: '/sounds/nature/walk-on-gravel.mp3', src: getAssetPath('/sounds/nature/walk-on-gravel.mp3'),
}, },
{ {
icon: <BsFillDropletFill />, icon: <BsFillDropletFill />,
id: 'droplets', id: 'droplets',
label: 'Droplets', label: 'Droplets',
src: '/sounds/nature/droplets.mp3', src: getAssetPath('/sounds/nature/droplets.mp3'),
}, },
{ {
icon: <FaTree />, icon: <FaTree />,
id: 'jungle', id: 'jungle',
label: 'Jungle', label: 'Jungle',
src: '/sounds/nature/jungle.mp3', src: getAssetPath('/sounds/nature/jungle.mp3'),
}, },
], ],
title: 'Nature', title: 'Nature',

View file

@ -3,6 +3,8 @@ import { BsSoundwave } from 'react-icons/bs/index';
import type { Category } from '../types'; import type { Category } from '../types';
import { getAssetPath } from '@/helpers/path';
export const noise: Category = { export const noise: Category = {
icon: <BsSoundwave />, icon: <BsSoundwave />,
id: 'noise', id: 'noise',
@ -11,19 +13,19 @@ export const noise: Category = {
icon: <GiSoundWaves />, icon: <GiSoundWaves />,
id: 'white-noise', id: 'white-noise',
label: 'White Noise', label: 'White Noise',
src: '/sounds/noise/white-noise.wav', src: getAssetPath('/sounds/noise/white-noise.wav'),
}, },
{ {
icon: <GiSoundWaves />, icon: <GiSoundWaves />,
id: 'pink-noise', id: 'pink-noise',
label: 'Pink Noise', label: 'Pink Noise',
src: '/sounds/noise/pink-noise.wav', src: getAssetPath('/sounds/noise/pink-noise.wav'),
}, },
{ {
icon: <GiSoundWaves />, icon: <GiSoundWaves />,
id: 'brown-noise', id: 'brown-noise',
label: 'Brown Noise', label: 'Brown Noise',
src: '/sounds/noise/brown-noise.wav', src: getAssetPath('/sounds/noise/brown-noise.wav'),
}, },
], ],
title: 'Noise', title: 'Noise',

View file

@ -18,6 +18,8 @@ import { FaBookOpen } from 'react-icons/fa6/index';
import type { Category } from '../types'; import type { Category } from '../types';
import { getAssetPath } from '@/helpers/path';
export const places: Category = { export const places: Category = {
icon: <MdLocationPin />, icon: <MdLocationPin />,
id: 'places', id: 'places',
@ -26,97 +28,97 @@ export const places: Category = {
icon: <BiSolidCoffeeAlt />, icon: <BiSolidCoffeeAlt />,
id: 'cafe', id: 'cafe',
label: 'Cafe', label: 'Cafe',
src: '/sounds/places/cafe.mp3', src: getAssetPath('/sounds/places/cafe.mp3'),
}, },
{ {
icon: <BiSolidPlaneAlt />, icon: <BiSolidPlaneAlt />,
id: 'airport', id: 'airport',
label: 'Airport', label: 'Airport',
src: '/sounds/places/airport.mp3', src: getAssetPath('/sounds/places/airport.mp3'),
}, },
{ {
icon: <FaChurch />, icon: <FaChurch />,
id: 'church', id: 'church',
label: 'Church', label: 'Church',
src: '/sounds/places/church.mp3', src: getAssetPath('/sounds/places/church.mp3'),
}, },
{ {
icon: <MdTempleBuddhist />, icon: <MdTempleBuddhist />,
id: 'temple', id: 'temple',
label: 'Temple', label: 'Temple',
src: '/sounds/places/temple.mp3', src: getAssetPath('/sounds/places/temple.mp3'),
}, },
{ {
icon: <MdConstruction />, icon: <MdConstruction />,
id: 'construction-site', id: 'construction-site',
label: 'Construction Site', label: 'Construction Site',
src: '/sounds/places/construction-site.mp3', src: getAssetPath('/sounds/places/construction-site.mp3'),
}, },
{ {
icon: <TbScubaMask />, icon: <TbScubaMask />,
id: 'underwater', id: 'underwater',
label: 'Underwater', label: 'Underwater',
src: '/sounds/places/underwater.mp3', src: getAssetPath('/sounds/places/underwater.mp3'),
}, },
{ {
icon: <TbBeerFilled />, icon: <TbBeerFilled />,
id: 'crowded-bar', id: 'crowded-bar',
label: 'Crowded Bar', label: 'Crowded Bar',
src: '/sounds/places/crowded-bar.mp3', src: getAssetPath('/sounds/places/crowded-bar.mp3'),
}, },
{ {
icon: <GiVillage />, icon: <GiVillage />,
id: 'night-village', id: 'night-village',
label: 'Night Village', label: 'Night Village',
src: '/sounds/places/night-village.mp3', src: getAssetPath('/sounds/places/night-village.mp3'),
}, },
{ {
icon: <FaSubway />, icon: <FaSubway />,
id: 'subway-station', id: 'subway-station',
label: 'Subway Station', label: 'Subway Station',
src: '/sounds/places/subway-station.mp3', src: getAssetPath('/sounds/places/subway-station.mp3'),
}, },
{ {
icon: <HiOfficeBuilding />, icon: <HiOfficeBuilding />,
id: 'office', id: 'office',
label: 'Office', label: 'Office',
src: '/sounds/places/office.mp3', src: getAssetPath('/sounds/places/office.mp3'),
}, },
{ {
icon: <FaShoppingBasket />, icon: <FaShoppingBasket />,
id: 'supermarket', id: 'supermarket',
label: 'Supermarket', label: 'Supermarket',
src: '/sounds/places/supermarket.mp3', src: getAssetPath('/sounds/places/supermarket.mp3'),
}, },
{ {
icon: <GiCarousel />, icon: <GiCarousel />,
id: 'carousel', id: 'carousel',
label: 'Carousel', label: 'Carousel',
src: '/sounds/places/carousel.mp3', src: getAssetPath('/sounds/places/carousel.mp3'),
}, },
{ {
icon: <AiFillExperiment />, icon: <AiFillExperiment />,
id: 'laboratory', id: 'laboratory',
label: 'Laboratory', label: 'Laboratory',
src: '/sounds/places/laboratory.mp3', src: getAssetPath('/sounds/places/laboratory.mp3'),
}, },
{ {
icon: <BiSolidDryer />, icon: <BiSolidDryer />,
id: 'laundry-room', id: 'laundry-room',
label: 'Laundry Room', label: 'Laundry Room',
src: '/sounds/places/laundry-room.mp3', src: getAssetPath('/sounds/places/laundry-room.mp3'),
}, },
{ {
icon: <IoRestaurant />, icon: <IoRestaurant />,
id: 'restaurant', id: 'restaurant',
label: 'Restaurant', label: 'Restaurant',
src: '/sounds/places/restaurant.mp3', src: getAssetPath('/sounds/places/restaurant.mp3'),
}, },
{ {
icon: <FaBookOpen />, icon: <FaBookOpen />,
id: 'library', id: 'library',
label: 'Library', label: 'Library',
src: '/sounds/places/library.mp3', src: getAssetPath('/sounds/places/library.mp3'),
}, },
], ],
title: 'Places', title: 'Places',

View file

@ -10,6 +10,8 @@ import { MdOutlineThunderstorm } from 'react-icons/md/index';
import type { Category } from '../types'; import type { Category } from '../types';
import { getAssetPath } from '@/helpers/path';
export const rain: Category = { export const rain: Category = {
icon: <BsFillCloudRainFill />, icon: <BsFillCloudRainFill />,
id: 'rain', id: 'rain',
@ -18,49 +20,49 @@ export const rain: Category = {
icon: <BsFillCloudRainFill />, icon: <BsFillCloudRainFill />,
id: 'light-rain', id: 'light-rain',
label: 'Light Rain', label: 'Light Rain',
src: '/sounds/rain/light-rain.mp3', src: getAssetPath('/sounds/rain/light-rain.mp3'),
}, },
{ {
icon: <BsFillCloudRainHeavyFill />, icon: <BsFillCloudRainHeavyFill />,
id: 'heavy-rain', id: 'heavy-rain',
label: 'Heavy Rain', label: 'Heavy Rain',
src: '/sounds/rain/heavy-rain.mp3', src: getAssetPath('/sounds/rain/heavy-rain.mp3'),
}, },
{ {
icon: <MdOutlineThunderstorm />, icon: <MdOutlineThunderstorm />,
id: 'thunder', id: 'thunder',
label: 'Thunder', label: 'Thunder',
src: '/sounds/rain/thunder.mp3', src: getAssetPath('/sounds/rain/thunder.mp3'),
}, },
{ {
icon: <GiWindow />, icon: <GiWindow />,
id: 'rain-on-window', id: 'rain-on-window',
label: 'Rain on Window', label: 'Rain on Window',
src: '/sounds/rain/rain-on-window.mp3', src: getAssetPath('/sounds/rain/rain-on-window.mp3'),
}, },
{ {
icon: <FaCarSide />, icon: <FaCarSide />,
id: 'rain-on-car-roof', id: 'rain-on-car-roof',
label: 'Rain on Car Roof', label: 'Rain on Car Roof',
src: '/sounds/rain/rain-on-car-roof.mp3', src: getAssetPath('/sounds/rain/rain-on-car-roof.mp3'),
}, },
{ {
icon: <BsUmbrellaFill />, icon: <BsUmbrellaFill />,
id: 'rain-on-umbrella', id: 'rain-on-umbrella',
label: 'Rain on Umbrella', label: 'Rain on Umbrella',
src: '/sounds/rain/rain-on-umbrella.mp3', src: getAssetPath('/sounds/rain/rain-on-umbrella.mp3'),
}, },
{ {
icon: <PiTentFill />, icon: <PiTentFill />,
id: 'rain-on-tent', id: 'rain-on-tent',
label: 'Rain on Tent', label: 'Rain on Tent',
src: '/sounds/rain/rain-on-tent.mp3', src: getAssetPath('/sounds/rain/rain-on-tent.mp3'),
}, },
{ {
icon: <FaLeaf />, icon: <FaLeaf />,
id: 'rain-on-leaves', id: 'rain-on-leaves',
label: 'Rain on Leaves', label: 'Rain on Leaves',
src: '/sounds/rain/rain-on-leaves.mp3', src: getAssetPath('/sounds/rain/rain-on-leaves.mp3'),
}, },
], ],
title: 'Rain', title: 'Rain',

View file

@ -14,6 +14,8 @@ import { PiVinylRecord } from 'react-icons/pi/index';
import type { Category } from '../types'; import type { Category } from '../types';
import { getAssetPath } from '@/helpers/path';
export const things: Category = { export const things: Category = {
icon: <MdSmartToy />, icon: <MdSmartToy />,
id: 'things', id: 'things',
@ -22,97 +24,97 @@ export const things: Category = {
icon: <BsFillKeyboardFill />, icon: <BsFillKeyboardFill />,
id: 'keyboard', id: 'keyboard',
label: 'Keyboard', label: 'Keyboard',
src: '/sounds/things/keyboard.mp3', src: getAssetPath('/sounds/things/keyboard.mp3'),
}, },
{ {
icon: <FaKeyboard />, icon: <FaKeyboard />,
id: 'typewriter', id: 'typewriter',
label: 'Typewriter', label: 'Typewriter',
src: '/sounds/things/typewriter.mp3', src: getAssetPath('/sounds/things/typewriter.mp3'),
}, },
{ {
icon: <RiFilePaper2Fill />, icon: <RiFilePaper2Fill />,
id: 'paper', id: 'paper',
label: 'Paper', label: 'Paper',
src: '/sounds/things/paper.mp3', src: getAssetPath('/sounds/things/paper.mp3'),
}, },
{ {
icon: <FaClock />, icon: <FaClock />,
id: 'clock', id: 'clock',
label: 'Clock', label: 'Clock',
src: '/sounds/things/clock.mp3', src: getAssetPath('/sounds/things/clock.mp3'),
}, },
{ {
icon: <GiWindchimes />, icon: <GiWindchimes />,
id: 'wind-chimes', id: 'wind-chimes',
label: 'Wind Chimes', label: 'Wind Chimes',
src: '/sounds/things/wind-chimes.mp3', src: getAssetPath('/sounds/things/wind-chimes.mp3'),
}, },
{ {
icon: <TbBowlFilled />, icon: <TbBowlFilled />,
id: 'singing-bowl', id: 'singing-bowl',
label: 'Singing Bowl', label: 'Singing Bowl',
src: '/sounds/things/singing-bowl.mp3', src: getAssetPath('/sounds/things/singing-bowl.mp3'),
}, },
{ {
icon: <FaFan />, icon: <FaFan />,
id: 'ceiling-fan', id: 'ceiling-fan',
label: 'Ceiling Fan', label: 'Ceiling Fan',
src: '/sounds/things/ceiling-fan.mp3', src: getAssetPath('/sounds/things/ceiling-fan.mp3'),
}, },
{ {
icon: <BiSolidDryer />, icon: <BiSolidDryer />,
id: 'dryer', id: 'dryer',
label: 'Dryer', label: 'Dryer',
src: '/sounds/things/dryer.mp3', src: getAssetPath('/sounds/things/dryer.mp3'),
}, },
{ {
icon: <GiFilmProjector />, icon: <GiFilmProjector />,
id: 'slide-projector', id: 'slide-projector',
label: 'Slide Projector', label: 'Slide Projector',
src: '/sounds/things/slide-projector.mp3', src: getAssetPath('/sounds/things/slide-projector.mp3'),
}, },
{ {
icon: <MdWaterDrop />, icon: <MdWaterDrop />,
id: 'boiling-water', id: 'boiling-water',
label: 'Boiling Water', label: 'Boiling Water',
src: '/sounds/things/boiling-water.mp3', src: getAssetPath('/sounds/things/boiling-water.mp3'),
}, },
{ {
icon: <RiBubbleChartFill />, icon: <RiBubbleChartFill />,
id: 'bubbles', id: 'bubbles',
label: 'Bubbles', label: 'Bubbles',
src: '/sounds/things/bubbles.mp3', src: getAssetPath('/sounds/things/bubbles.mp3'),
}, },
{ {
icon: <MdRadio />, icon: <MdRadio />,
id: 'tuning-radio', id: 'tuning-radio',
label: 'Tuning Radio', label: 'Tuning Radio',
src: '/sounds/things/tuning-radio.mp3', src: getAssetPath('/sounds/things/tuning-radio.mp3'),
}, },
{ {
icon: <IoIosRadio />, icon: <IoIosRadio />,
id: 'morse-code', id: 'morse-code',
label: 'Morse Code', label: 'Morse Code',
src: '/sounds/things/morse-code.mp3', src: getAssetPath('/sounds/things/morse-code.mp3'),
}, },
{ {
icon: <GiWashingMachine />, icon: <GiWashingMachine />,
id: 'washing-machine', id: 'washing-machine',
label: 'Washing Machine', label: 'Washing Machine',
src: '/sounds/things/washing-machine.mp3', src: getAssetPath('/sounds/things/washing-machine.mp3'),
}, },
{ {
icon: <PiVinylRecord />, icon: <PiVinylRecord />,
id: 'vinyl-effect', id: 'vinyl-effect',
label: 'Vinyl Effect', label: 'Vinyl Effect',
src: '/sounds/things/vinyl-effect.mp3', src: getAssetPath('/sounds/things/vinyl-effect.mp3'),
}, },
{ {
icon: <TbWiper />, icon: <TbWiper />,
id: 'windshield-wipers', id: 'windshield-wipers',
label: 'Windshield Wipers', label: 'Windshield Wipers',
src: '/sounds/things/windshield-wipers.mp3', src: getAssetPath('/sounds/things/windshield-wipers.mp3'),
}, },
], ],
title: 'Things', title: 'Things',

View file

@ -5,6 +5,8 @@ import { TbSailboat } from 'react-icons/tb/index';
import type { Category } from '../types'; import type { Category } from '../types';
import { getAssetPath } from '@/helpers/path';
export const transport: Category = { export const transport: Category = {
icon: <FaCarSide />, icon: <FaCarSide />,
id: 'transport', id: 'transport',
@ -13,37 +15,37 @@ export const transport: Category = {
icon: <BiSolidTrain />, icon: <BiSolidTrain />,
id: 'train', id: 'train',
label: 'Train', label: 'Train',
src: '/sounds/transport/train.mp3', src: getAssetPath('/sounds/transport/train.mp3'),
}, },
{ {
icon: <BiSolidTrain />, icon: <BiSolidTrain />,
id: 'inside-a-train', id: 'inside-a-train',
label: 'Inside a Train', label: 'Inside a Train',
src: '/sounds/transport/inside-a-train.mp3', src: getAssetPath('/sounds/transport/inside-a-train.mp3'),
}, },
{ {
icon: <BiSolidPlaneAlt />, icon: <BiSolidPlaneAlt />,
id: 'airplane', id: 'airplane',
label: 'Airplane', label: 'Airplane',
src: '/sounds/transport/airplane.mp3', src: getAssetPath('/sounds/transport/airplane.mp3'),
}, },
{ {
icon: <GiSubmarine />, icon: <GiSubmarine />,
id: 'submarine', id: 'submarine',
label: 'Submarine', label: 'Submarine',
src: '/sounds/transport/submarine.mp3', src: getAssetPath('/sounds/transport/submarine.mp3'),
}, },
{ {
icon: <GiSailboat />, icon: <GiSailboat />,
id: 'sailboat', id: 'sailboat',
label: 'Sailboat', label: 'Sailboat',
src: '/sounds/transport/sailboat.mp3', src: getAssetPath('/sounds/transport/sailboat.mp3'),
}, },
{ {
icon: <TbSailboat />, icon: <TbSailboat />,
id: 'rowing-boat', id: 'rowing-boat',
label: 'Rowing Boat', label: 'Rowing Boat',
src: '/sounds/transport/rowing-boat.mp3', src: getAssetPath('/sounds/transport/rowing-boat.mp3'),
}, },
], ],
title: 'Transport', title: 'Transport',

View file

@ -6,6 +6,8 @@ import { RiSparkling2Fill } from 'react-icons/ri/index';
import type { Category } from '../types'; import type { Category } from '../types';
import { getAssetPath } from '@/helpers/path';
export const urban: Category = { export const urban: Category = {
icon: <FaCity />, icon: <FaCity />,
id: 'urban', id: 'urban',
@ -14,43 +16,43 @@ export const urban: Category = {
icon: <PiRoadHorizonFill />, icon: <PiRoadHorizonFill />,
id: 'highway', id: 'highway',
label: 'Highway', label: 'Highway',
src: '/sounds/urban/highway.mp3', src: getAssetPath('/sounds/urban/highway.mp3'),
}, },
{ {
icon: <FaRoad />, icon: <FaRoad />,
id: 'road', id: 'road',
label: 'Road', label: 'Road',
src: '/sounds/urban/road.mp3', src: getAssetPath('/sounds/urban/road.mp3'),
}, },
{ {
icon: <PiSirenBold />, icon: <PiSirenBold />,
id: 'ambulance-siren', id: 'ambulance-siren',
label: 'Ambulance Siren', label: 'Ambulance Siren',
src: '/sounds/urban/ambulance-siren.mp3', src: getAssetPath('/sounds/urban/ambulance-siren.mp3'),
}, },
{ {
icon: <BsSoundwave />, icon: <BsSoundwave />,
id: 'busy-street', id: 'busy-street',
label: 'Busy Street', label: 'Busy Street',
src: '/sounds/urban/busy-street.mp3', src: getAssetPath('/sounds/urban/busy-street.mp3'),
}, },
{ {
icon: <BsPeopleFill />, icon: <BsPeopleFill />,
id: 'crowd', id: 'crowd',
label: 'Crowd', label: 'Crowd',
src: '/sounds/urban/crowd.mp3', src: getAssetPath('/sounds/urban/crowd.mp3'),
}, },
{ {
icon: <BiSolidTraffic />, icon: <BiSolidTraffic />,
id: 'traffic', id: 'traffic',
label: 'Traffic', label: 'Traffic',
src: '/sounds/urban/traffic.mp3', src: getAssetPath('/sounds/urban/traffic.mp3'),
}, },
{ {
icon: <RiSparkling2Fill />, icon: <RiSparkling2Fill />,
id: 'fireworks', id: 'fireworks',
label: 'Fireworks', label: 'Fireworks',
src: '/sounds/urban/fireworks.mp3', src: getAssetPath('/sounds/urban/fireworks.mp3'),
}, },
], ],
title: 'Urban', title: 'Urban',

7
src/helpers/path.ts Normal file
View file

@ -0,0 +1,7 @@
export function getAssetPath(relativePath: string): string {
const baseURL = import.meta.env.BASE_URL;
const withoutTrailingSlash = baseURL.replace(/\/+$/, '');
const withoutLeadingSlash = relativePath.replace(/^\/+/, '');
return `${withoutTrailingSlash}/${withoutLeadingSlash}`;
}