Build an Anonymous Voice Changer Pitch Slider on iOS
How to build a real-time voice changer screen on iOS, from the AVAudioEngine pitch graph to the slider, presets, and waveform, plus an honest note on anonymity.
TL;DR
A voice changer on iOS comes down to one audio node and one control: route the microphone through AVAudioUnitTimePitch in an AVAudioEngine graph, then drive its pitch value from a slider. That gives real-time shifting with no third-party SDK, and the fastest way to build the screen, the large pitch slider, preset chips, waveform, and record button, is to start from a free VP0 iOS design and generate it with Claude Code or Cursor. Pitch shifting changes how a voice sounds, but it is not a guarantee of anonymity against forensic analysis.
A voice changer on iOS comes down to one audio node and one control: route the microphone through AVAudioUnitTimePitch in an AVAudioEngine graph, then drive its pitch value from a slider. That gives you real-time shifting from a deep voice to a high one without any third-party SDK, and the screen itself, the large pitch slider, the preset chips, the waveform, and the record button, is the fastest part to get right by starting from a free VP0 iOS design and building it with Claude Code or Cursor. One honest caveat up front: pitch shifting changes how a voice sounds to a listener, but it is not a guarantee of anonymity against forensic voice analysis, so treat “anonymous” as an effect, not a security promise.
How does a voice changer actually shift pitch on iOS?
It shifts pitch by passing live audio through AVAudioUnitTimePitch, an audio unit Apple ships inside the AVFAudio framework. You build a small graph in AVAudioEngine: the input node (the microphone) connects to an AVAudioUnitTimePitch node, which connects to the main mixer and out to the speaker or a file. The effect changes pitch independently of speed, which is exactly what a voice changer needs, since speeding audio up to raise pitch would also make speech unintelligible.
The control you expose is the node’s pitch property, measured in cents. One octave is 1,200 cents, and the property accepts roughly minus 2,400 to plus 2,400, so a slider that spans about minus 1,200 to plus 1,200 covers the usable range for a human voice before it turns into obvious chipmunk or monster territory. Setting pitch live while the engine runs is what makes the slider feel instant. For the recording-and-export path rather than live monitoring, the same node sits in an offline render so the processed file matches what the user heard.
The whole graph is a handful of lines, which is why no SDK is needed:
let engine = AVAudioEngine()
let pitch = AVAudioUnitTimePitch()
pitch.pitch = 0 // cents; bind this to the slider
let input = engine.inputNode
let format = input.inputFormat(forBus: 0)
engine.attach(pitch)
engine.connect(input, to: pitch, format: format)
engine.connect(pitch, to: engine.mainMixerNode, format: format)
try AVAudioSession.sharedInstance().setCategory(.playAndRecord, options: [.defaultToSpeaker])
try engine.start()
After that, the only line the slider runs is pitch.pitch = Float(cents), so the control and the effect stay in lockstep with almost no code between them.
Mapping the pitch slider to something that sounds right
The slider should map to cents, with presets, because a raw cents value means nothing to a user. A clean approach is a continuous slider from a low setting to a high one, plus a row of preset chips like Deep, Natural, and High that jump the slider to fixed cent values. Most people never touch the raw number; they tap a preset and nudge from there, so the presets carry the experience and the slider handles fine adjustment.
Treat the slider as an accessible control, not just a visual one. Give it an accessibility value that announces the current setting (Deep, Natural, High, or a percentage) so VoiceOver users know where they are, and add a light haptic when the value crosses a preset boundary so the change is felt as well as heard. Updating the pitch on every drag tick is fine because setting the property is cheap, so there is no need to debounce; the bigger win is making the value legible the instant it changes.
Quality depends on the method you pick, and there are three realistic ones.
| Method | Sounds like | Effort | Real-time |
|---|---|---|---|
| AVAudioUnitTimePitch | Clear shift, some chipmunk effect at extremes | Low | Yes |
| Formant-preserving shift | More natural across a wide range | High | Harder |
| Third-party audio SDK | Varies by vendor | Low to medium | Usually |
The built-in unit is the right starting point for almost every app because it is free, real-time, and good enough for a fun or privacy-flavored changer. Its limit shows at the extremes, where shifting pitch without preserving formants gives the classic cartoon sound. If your product needs a disguised voice that still sounds like a real person across a wide range, that is a formant-shifting problem, which is meaningfully harder and usually where a specialized library or your own overlap-add processing comes in.
Does pitch shifting actually make a voice anonymous?
Not on its own, and the app should not imply otherwise. Shifting pitch reliably changes how a voice sounds to a human listener, which is enough for casual sharing, prank clips, or keeping a voice off a public post. It is not a defense against forensic or automated speaker identification, which can work from features that survive a simple pitch change.
If anonymity matters to your users, the honest design is to combine effects, for example a pitch shift plus light formant change plus background noise, and to say plainly in the interface what the tool does and does not do. Overstating protection is both a trust problem and, for a privacy or safety audience, a real risk. The safer framing in copy is that the changer disguises a voice for everyday sharing, and that anyone who needs genuine identity protection should not rely on an audio effect alone.
Designing the screen: slider, presets, waveform, and playback
The screen is a known pattern, so it is worth starting from a finished layout rather than positioning a slider by hand. A voice changer screen usually has a large central pitch slider with a live value, a row of preset chips, a record button, a waveform that reacts to input level, and a before-and-after playback control so users can compare the original and the shifted take. Getting the slider thumb size, the live value label, and the spacing to feel right is fiddly, and Apple’s slider guidance is worth following so the control reads as native.
The VP0 library is built for exactly this handoff: each design has a hidden source page an AI builder reads from a pasted link, so you open an audio or recorder layout, copy its link, and prompt your tool:
Build this as a SwiftUI voice changer screen.
Read the layout and tokens from this VP0 source page: <pasted VP0 link>.
Wire the central slider to an AVAudioUnitTimePitch pitch value in cents,
and add Deep, Natural, and High presets.
For the parts around the slider, the audio waveform recorder UI covers the record-and-waveform pattern most voice apps reuse, and the AI voice cloning app UI shows a closely related screen layout in SwiftUI, and a ham radio frequency waterfall display takes the same audio graph into FFT-based spectrum analysis. VP0 gives you the interface and the structure; the audio graph and any formant work are still your code, which is the right division of labor since the DSP is where your app earns its character.
Recording and exporting the shifted voice
Most voice changer apps need to save the result, not just monitor it live, and the clean way is to tap the processed node and write its buffers to a file. You install a tap on the main mixer or the pitch node, create an AVAudioFile at a destination URL, and write each buffer the tap delivers, so the file ends up holding the shifted audio exactly as the user heard it. A standard share sheet then hands the clip to Messages, a voice note, or another app.
A few details keep the export reliable. Match the file’s format to the tap’s buffer format, or the write throws. Stop the tap and close the file when recording ends so the final buffers flush to disk. And when you only need the processed file rather than live monitoring, the engine’s offline manual rendering mode runs the same graph faster than real time, which is the right tool for shifting an existing recording instead of the live microphone. That split, live monitoring for the preview and offline rendering for the export, keeps both paths simple and gives you a file that matches the preview.
Common mistakes building a voice changer UI
The first mistake is forgetting the microphone permission string. iOS will crash the app the moment you start the input node if NSMicrophoneUsageDescription is missing from the Info.plist, and reviewers reject apps whose permission text is vague. The second is using the wrong audio session category: a changer that both listens and plays needs the playAndRecord category, and skipping the session setup gives you silence or a route stuck on the earpiece.
A few more are about feel. A slider with no live value leaves users guessing what they are setting, so show the effect or a labeled value as they drag. Real-time monitoring through the speaker can feed back into the microphone, so design for headphones or add monitoring that the user toggles. And pushing the pitch to the extremes by default makes every voice sound like a cartoon, which buries the more useful subtle range. Start presets near the natural middle and let users go further on purpose.
The single node that does the real work
The whole effect rests on one Apple-provided audio unit, which is why no third-party SDK is needed. Apple’s AVAudioUnitTimePitch documentation describes a processing node that changes pitch independently of playback rate, exactly the control a voice changer needs, and it slots straight into an AVAudioEngine graph between input and output. Driving its pitch parameter from a slider gives real-time shifting at system-grade latency. The honesty caveat matters just as much: shifting pitch alters how a voice sounds to a listener, but it does not erase the speaker-specific features forensic analysis relies on, so the screen should offer fun and privacy-by-obscurity, never a promise of true anonymity.
What to choose
For almost every voice changer, choose the built-in path: an AVAudioEngine graph with AVAudioUnitTimePitch, a slider mapped to cents, and a few presets. It is free, real-time, and reliable, and it covers prank apps, voice-flavored social features, and casual privacy use without a third-party dependency. Reach for formant-preserving processing or a specialized SDK only when you need a disguised voice that stays natural across a wide range.
Build the audio first as a tiny prototype, then put a real interface on it: start from a free VP0 design, generate the SwiftUI screen with Claude Code or Cursor, and keep your effort on the sound, the presets, and honest copy about what the disguise does.
Frequently asked questions
How do I build an anonymous voice changer with a pitch slider on iOS?
Route the microphone through an AVAudioUnitTimePitch node in an AVAudioEngine graph and bind a slider to its pitch value in cents, where 1,200 cents equals one octave. Add Deep, Natural, and High presets so users are not setting raw numbers. For the screen, start from a free VP0 audio design and build it in SwiftUI with Claude Code or Cursor, then keep the audio graph and any formant work as your own code.
Does a pitch slider make a voice truly anonymous?
No. A pitch change reliably alters how a voice sounds to a listener, which is fine for casual sharing or pranks, but it does not defend against forensic or automated speaker identification. If real anonymity matters, combine effects and state clearly in the interface that the tool disguises a voice rather than guaranteeing privacy.
What is the difference between pitch and speed in a voice changer?
Pitch is how high or low the voice sounds, and speed is how fast it plays. AVAudioUnitTimePitch changes pitch independently of speed, which is what you want, because raising pitch by speeding audio up would also make speech sound rushed and unnatural. Keep the slider bound to the pitch property and leave the rate alone unless you specifically want a fast or slow effect.
Why does my voice changer sound like a chipmunk?
Because a plain pitch shift moves the formants along with the pitch, which is the cartoon sound at large settings. Keep the default range modest, around one octave up or down, and reserve the extremes for an explicit effect. For a disguised voice that still sounds human across a wide range, you need formant-preserving processing, which is more work than the built-in unit.
Where can I get a free UI template for a voice changer screen?
VP0 is a free iOS design library where every screen has an AI-readable source page, so you can browse an audio or recorder layout, copy its link, and have Claude Code or Cursor build it as a SwiftUI screen with the slider, presets, waveform, and playback wired up. You supply the audio engine; the interface comes from the design.
What the VP0 community is asking
How do I build an anonymous voice changer with a pitch slider on iOS?
Route the microphone through an AVAudioUnitTimePitch node in an AVAudioEngine graph and bind a slider to its pitch value in cents, where 1,200 cents equals one octave. Add Deep, Natural, and High presets so users are not setting raw numbers. For the screen, start from a free VP0 audio design and build it in SwiftUI with Claude Code or Cursor, then keep the audio graph and any formant work as your own code.
Does a pitch slider make a voice truly anonymous?
No. A pitch change reliably alters how a voice sounds to a listener, which is fine for casual sharing or pranks, but it does not defend against forensic or automated speaker identification. If real anonymity matters, combine effects and state clearly in the interface that the tool disguises a voice rather than guaranteeing privacy.
What is the difference between pitch and speed in a voice changer?
Pitch is how high or low the voice sounds, and speed is how fast it plays. AVAudioUnitTimePitch changes pitch independently of speed, which is what you want, because raising pitch by speeding audio up would also make speech sound rushed and unnatural. Keep the slider bound to the pitch property and leave the rate alone unless you specifically want a fast or slow effect.
Why does my voice changer sound like a chipmunk?
Because a plain pitch shift moves the formants along with the pitch, which is the cartoon sound at large settings. Keep the default range modest, around one octave up or down, and reserve the extremes for an explicit effect. For a disguised voice that still sounds human across a wide range, you need formant-preserving processing, which is more work than the built-in unit.
Where can I get a free UI template for a voice changer screen?
VP0 is a free iOS design library where every screen has an AI-readable source page, so you can browse an audio or recorder layout, copy its link, and have Claude Code or Cursor build it as a SwiftUI screen with the slider, presets, waveform, and playback wired up. You supply the audio engine; the interface comes from the design.
Part of the Native Hardware, Sensors & Device Features hub. Browse all VP0 topics →
Keep reading
Bluetooth Hearing Aid EQ Mixer UI for iOS
Build a Bluetooth hearing aid EQ mixer UI for iOS in SwiftUI, bound to AVAudioUnitEQ. Here is the audio path, the band sliders, and what to keep honest.
Apple HealthKit Pedometer UI: Free Step Counter Templates
Build a step counter UI for Apple HealthKit: HealthKit for daily totals and charts, Core Motion's CMPedometer for the live number, from a free template.
Bluetooth Mesh Network Chat Interface for iOS
Build a Bluetooth mesh network chat interface for iOS with MultipeerConnectivity. Here is the transport choice, the message UI, and the states it must show.
XR fitness app companion UI for iOS: the SwiftUI screens
Build the iOS companion for an XR fitness app: setup, live HealthKit metrics, summary, and history that stay in sync with the headset workout.
Biological Age Calculator Dashboard UI for iOS: Honest
Design a biological age dashboard: the estimate framed honestly, trends over absolutes, factor breakdowns tied to evidence, and zero longevity fear-mongering.
Camera Live Object Detection: The Bounding Box UI
Drawing live bounding boxes over a camera feed is mostly coordinate math. Here is how to map Vision results to view space and keep the overlay smooth on iOS.