| Crates.io | animalese |
| lib.rs | animalese |
| version | 0.2.0 |
| created_at | 2025-12-02 18:20:10.479815+00 |
| updated_at | 2025-12-02 19:37:08.507909+00 |
| description | Rust library for generating Animal Crossing-style animalese speech sounds |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1962360 |
| size | 1,968,076 |
Rust library for generating Animal Crossing-style "animalese" speech sounds.
Assets come courtesy of https://github.com/joshxviii/animalese-typing-desktop, also MIT Licensed.
Add to your Cargo.toml:
[dependencies]
animalese = "0.2"
use animalese::Animalese;
let engine = Animalese::new()?;
engine.speak("hello world")?;
use animalese::{Animalese, VoiceProfile, VoiceType};
let mut engine = Animalese::new()?;
let profile = VoiceProfile {
voice_type: VoiceType::M1,
pitch_shift: -5.0, // Lower pitch
pitch_variation: 1.0, // High variation for natural sound
volume: 0.8,
intonation: 0.0, // No pitch glide
};
engine.set_profile(profile);
engine.speak("I'm Tom Nook")?;
Note on pitch variation: Higher values (0.8-1.2) create more organic, natural-sounding speech by randomizing each letter's pitch. Lower values (0.0-0.3) sound more robotic and monotone. The default of 0.8 provides good variation without being distracting.
use animalese::Animalese;
let engine = Animalese::new()?;
// Automatic rising intonation for questions
engine.speak_question("What's that?")?;
// Excited speech (higher pitch + rising)
engine.speak_excited("Amazing!")?;
// Statement with falling intonation
engine.speak_statement("I see.")?;
// Or manually control intonation (-1.0 to 1.0)
let mut profile = engine.profile();
profile.intonation = 0.5; // Rising pitch over sentence
engine.set_profile(profile);
engine.speak("Going up")?;
use animalese::Animalese;
// Only if you have custom audio files matching the expected format
let engine = Animalese::with_custom_assets("./my_assets/voice")?;
Interactive typing sounds:
cargo install animalese
animalese
Speak text directly:
animalese "hello world"
animalese --voice m2 --pitch=-3.0 "Tom Nook here"
animalese --intonation=0.6 "What's that?"
Available options:
--voice (-v): Voice type (f1-f4, m1-m4)--pitch (-p): Pitch shift in semitones (-12.0 to 12.0)--variation (-r): Random pitch variation (0.0 to 2.0, default: 0.8)--intonation (-i): Pitch glide over sentence (-1.0 falling to 1.0 rising)--volume (-V): Volume level (0.0 to 1.0)--list (-l): Show available voices--test (-t): Play test phraseUses kira for audio playback - a game audio library designed for real-time sound with individual instance control, tweening, and smooth fade-outs. This provides clean audio without clicks or pops, even during rapid-fire typing in interactive mode.
Why kira:
MIT