import { Meta, ArgTypes, Description, Story, Preview } from '@storybook/blocks' import { useState } from 'react' import { useHowl } from '../src/useHowl.js' import sound1 from './static/audio/sound1.mp3'
function MyComponent() {
const { howl, state, error, load } = useHowl({
src: './mysound.mp3',
})
// howl can be handed to <Play />
}
Values provided by useHowl are:
Variable | Description |
---|---|
howl | Howl instance |
state | 'unloaded', 'loading', or 'loaded' |
error | { message, id } of load error, if any. |
load | Call this function to load source if you set preload to false. |