UNPKG

ez-web-audio

Version:

Making the Web Audio API super EZ since 2024.

35 lines 1.1 kB
import { AudioError } from './audio-error'; /** * Error thrown when a note identifier is invalid. * * Note identifiers follow the format: Letter + optional accidental + octave * - Letters: A-G (case insensitive) * - Accidentals: # (sharp), b (flat), or none (natural) * - Octave: 0-8 * * Valid examples: A4, Bb3, C#5, D2, Eb6 * Invalid examples: H4, A9, B##3, 4A * * @example * ```typescript * function parseNote(identifier: string) { * if (!isValidNote(identifier)) { * throw new InvalidNoteError( * `Invalid note: "${identifier}". Expected format: Letter + optional accidental + octave (e.g., A4, Bb3, C#5).`, * identifier * ); * } * } * ``` */ export declare class InvalidNoteError extends AudioError { readonly identifier: string; /** * Create a new InvalidNoteError. * * @param message - Human-readable error description with actionable fix * @param identifier - The invalid note identifier that was provided */ constructor(message: string, identifier: string); } //# sourceMappingURL=invalid-note-error.d.ts.map