audio
Audio controls
- Sound On
- Sound Off
- Volume adjust
- Cooldown
showToast({
message: "New message",
type: "success",
audio: {
enabled: true,
},
});
showToast({
message: "New message",
type: "success",
audio: {
enabled: false,
},
});
showToast({
message: "New message",
type: "success",
audio: {
volume: 0.9, // max 1
},
});
showToast({
message: "New message",
type: "success",
audio: {
cooldown: 800, // ms
},
});
Default sounds
- On Success
- On Error
- On Info
- On Warning
const { showToast, sounds } = useToast();
showToast({
message: "New message",
type: "success",
audio: {
audioFile: sounds.success
},
});
const { showToast, sounds } = useToast();
showToast({
message: "New message",
type: "error",
audio: {
audioFile: sounds.error,
},
});
const { showToast, sounds } = useToast();
showToast({
message: "New message",
type: "info",
audio: {
audioFile: sounds.info
},
});
const { showToast, sounds } = useToast();
showToast({
message: "New message",
type: "warning",
audio: {
audioFile: sounds.warning
},
});
Custom sound
showToast({
message: "New message",
type: "success",
audio: {
audioFile: "YOUR_AUDIO_URL"
},
});