audio-producer

安装量: 101
排名: #8261

安装

npx skills add https://github.com/daffy0208/ai-dev-standards --skill audio-producer

Audio Producer Skill

I help you build audio players, process audio, and create interactive sound experiences for the web.

What I Do

Audio Playback:

Custom audio players Playlist management Playback controls (play, pause, seek, volume) Waveform visualization

Audio Processing:

Audio effects (reverb, delay, filters) Equalization and mixing Audio recording Real-time audio manipulation

Interactive Audio:

Background music and sound effects User interaction sounds Spatial audio Audio notifications Custom Audio Player // components/AudioPlayer.tsx 'use client' import { useState, useRef, useEffect } from 'react'

interface AudioPlayerProps { src: string title?: string artist?: string }

export function AudioPlayer({ src, title, artist }: AudioPlayerProps) { const audioRef = useRef(null) const [playing, setPlaying] = useState(false) const [currentTime, setCurrentTime] = useState(0) const [duration, setDuration] = useState(0) const [volume, setVolume] = useState(1)

useEffect(() => { const audio = audioRef.current if (!audio) return

const updateTime = () => setCurrentTime(audio.currentTime)
const updateDuration = () => setDuration(audio.duration)

audio.addEventListener('timeupdate', updateTime)
audio.addEventListener('loadedmetadata', updateDuration)
audio.addEventListener('ended', () => setPlaying(false))

return () => {
  audio.removeEventListener('timeupdate', updateTime)
  audio.removeEventListener('loadedmetadata', updateDuration)
  audio.removeEventListener('ended', () => setPlaying(false))
}

}, [])

const togglePlay = () => { if (!audioRef.current) return

if (playing) {
  audioRef.current.pause()
} else {
  audioRef.current.play()
}
setPlaying(!playing)

}

const handleSeek = (e: React.ChangeEvent) => { const time = parseFloat(e.target.value) setCurrentTime(time) if (audioRef.current) { audioRef.current.currentTime = time } }

const handleVolumeChange = (e: React.ChangeEvent) => { const vol = parseFloat(e.target.value) setVolume(vol) if (audioRef.current) { audioRef.current.volume = vol } }

const formatTime = (seconds: number) => { const mins = Math.floor(seconds / 60) const secs = Math.floor(seconds % 60) return ${mins}:${secs.toString().padStart(2, '0')} }

return (

返回排行榜