Audacity error code 9997 means the project sample rate does not match your audio device or host, and you fix it by aligning those settings.
If Audacity throws audacity error code 9997 and a message about an invalid sample rate, it usually means your project rate, device settings, or audio host do not agree. The good news is that this type of recording failure almost always comes from mismatched settings, not a broken microphone or interface, so a careful reset brings sessions back on track.
This guide carefully walks through what Audacity error code 9997 really means, why it appears on Windows, macOS, and Linux, and how to clear it without losing work. You will see what to check in the app, what to change in system sound panels, and how to pick hosts and rates that record cleanly.
What Audacity Error Code 9997 Actually Means
When you see error code 9997, Audacity is passing along a message from the PortAudio layer that the audio device cannot open with the sample rate it was given. The dialog often reads along the lines of error opening recording device or playback device with an invalid sample rate note. In plain terms, the app tried to start the device at one rate while the system or hardware expected another.
Audacity lets every project carry its own project rate value, shown in the lower left corner of the window. Your operating system and audio interface also keep their own rate preferences, and individual tracks can carry rates as well. If any of those numbers fight each other, the engine blocks the recording request and raises error 9997 instead of risking distorted or silent audio.
On some setups the message appears as soon as Audacity opens, while on others it only appears when you add extra tracks or switch hosts. That pattern points straight at configuration rather than the microphone capsule, cable, or interface hardware.
Fixing Audacity Error Code 9997 On Windows And Mac
Before you start changing drivers and reinstalling software, it helps to run through a short set of platform specific checks. These steps cover the most common paths that cause Audacity error code 9997 when you record with a USB mic, interface, or the built in sound hardware.
Windows Quick Fix Steps
- Match the project rate — In the lower left corner of the Audacity window, set the project rate to 44100 Hz, then test 48000 Hz if needed. These rates are safe defaults for most devices.
- Check Windows sound rates — Open the classic Sound control panel, then under both Playback and Recording tabs, open your active device properties and set the default format to the same rate you chose in Audacity.
- Try a different audio host — In the main toolbar, switch the host field between MME, Windows DirectSound, and WASAPI. Many setups record cleanly on one host and reject the same project rate on another.
- Adjust channel count — In the recording device menu, test Mono and Stereo in turn. Some onboard chips and loopback devices only accept one option without throwing the error.
- Restart the app after changes — Close Audacity, wait a few seconds, then open it again so it can reopen the driver with the new rates you set.
Mac Quick Fix Steps
- Set the device rate in Audio MIDI Setup — Open Audio MIDI Setup from Applications, then pick your microphone or interface and set its sample rate to 44100 Hz or 48000 Hz.
- Match the rate inside Audacity — Set the project rate in the lower left corner to the same value you picked in Audio MIDI Setup and confirm that the track control panels show the same rate.
- Pick the right input and output — In Audacity preferences, select the same device for recording and playback that you adjusted in the system utility so they share timing.
- Close other audio apps — Quit video call tools, screen recorders, or music players that might grab the device with a different rate and block Audacity from opening it cleanly.
Linux And Other Setups
On Linux distributions the same principle applies, but you adjust rates in tools such as PulseAudio Volume Control, PipeWire utilities, or the desktop sound panel. The goal stays the same across platforms: every part of the chain, from interface control panel through system sound settings to the Audacity project, should share one agreed sample rate, usually 44100 or 48000 Hz.
Common Causes Behind This Error Code 9997
Once you know that error 9997 points to a rate mismatch, it becomes easier to spot patterns in when it appears. A few recurring situations show up again and again in user reports and official guidance, and they mostly come down to hidden rate switches, strict hosts, and devices with tight channel rules.
One frequent trigger is a system update or driver change that silently resets default formats in the operating system. Windows updates in particular like to move devices to higher rates that look appealing in a menu but do not match the defaults that Audacity uses for new projects. The next time you open an older project with a lower project rate, the conflict can surface as error code 9997 during recording.
Another known pattern involves Windows WASAPI. Many reports show that projects which record cleanly with MME or DirectSound fail with 9997 when the host switches to WASAPI, even when the visible rate fields line up. In those cases the easiest approach is to move back to a host that works, because sound quality does not gain much when you trade a working driver for a strict one.
External interfaces and multichannel devices introduce their own twist. Some hardware only accepts specific channel counts at certain rates, or reserves higher rates for proprietary control panels. When Audacity tries to open six or more channels on such a device, the driver may reject the combination and signal invalid sample rate while the number in the box looks fine.
Step By Step Fixes For Audacity Error Code 9997
Once you have a sense of the likely cause, it helps to follow one clean path instead of changing random settings. The checklist below builds from simple to advanced so you can stop as soon as recording starts to work again.
- Standardize on one rate — Pick either 44100 Hz or 48000 Hz and apply it to your device in the system sound controls, the interface control panel if one exists, and the Audacity project rate field.
- Align track rates — In each track control panel, confirm that the rate matches your chosen standard. If it does not, resample that track so all tracks in the project share one rate.
- Switch the audio host — Test each host option that Audacity offers on your platform. If WASAPI throws error code 9997 while MME or DirectSound record cleanly, stick with the stable option.
- Test mono versus stereo — Set your recording device menu to Mono, record a short clip, then repeat with Stereo. Keep the mode that records without errors and gives the channel layout you need.
- Try a brand new project — Create a fresh project with no older tracks, set its project rate to your standard, then record. If the new project works, the issue may live in the old file’s track rates.
- Update drivers and firmware — For USB interfaces, download the latest driver from the maker and apply any control panel updates. Old drivers sometimes misreport allowed rates to host apps.
- Reinstall or update Audacity — As a last resort, install the most recent stable version so you benefit from bug fixes related to host handling and error reporting.
Sample Rate And Host Settings That Usually Work Best
Most everyday recording tasks sit at modest sample rates that are friendly to both hardware and software. In many cases 44100 Hz matches music playback rates, while 48000 Hz lines up better with video and broadcast work. Higher rates demand more bandwidth from drivers and interfaces and are more likely to trigger strict checks that result in error 9997.
Choosing an audio host often creates confusion, yet the guidelines are fairly simple. On Windows, MME remains the most forgiving option for mixed hardware, DirectSound can offer lower latency on some machines, and WASAPI tends to work best when both the device and project stay at the system default rate. On macOS, the Core Audio host talks to the system layer that Audio MIDI Setup controls, so keeping rates in step there keeps Audacity happy. On Linux, ALSA and Pulse clients depend on the desktop audio service, which can resample when needed as long as starting rates are reasonable.
With those ideas in mind, it becomes clear why a modest rate such as 44100 Hz or 48000 Hz with a host that cooperates presents the least friction. You still capture full quality from typical microphones and interfaces, yet you just reduce the chance that a driver will reject the request with a message about an invalid sample rate.
Typical Places To Set Sample Rate
| Platform | Where You Change The Rate | Common Values |
|---|---|---|
| Windows | Sound control panel device properties under Playback and Recording tabs | 44100 Hz, 48000 Hz |
| macOS | Audio MIDI Setup for the chosen input and output device | 44100 Hz, 48000 Hz |
| Linux | Desktop sound settings or PulseAudio and PipeWire tools | 44100 Hz, 48000 Hz |
Keeping Error 9997 Away During Later Sessions
Once you fix the problem, a few small habits can keep Audacity error code 9997 from returning during later recording work. The goal is to keep rates stable, avoid silent changes from updates, and test new setups before you rely on them for real sessions.
- Create a standard template — Save a blank project with your preferred project rate, hosts, and device choices so new projects always start from a known set of values.
- Lock in device defaults — Periodically confirm that your system sound panels still show the rates you picked, especially after major operating system updates.
- Connect gear before you open Audacity — Plug in USB microphones and interfaces first so the app can detect them cleanly and match rates when it launches.
- Test new devices with a short take — Record a few seconds while watching the meters to confirm that the device accepts the current project rate before you start a long take.
- Keep one rate across apps — Set other recording and streaming tools on your machine to the same sample rate so they do not fight over what the interface should use.
audacity error code 9997 can feel cryptic, yet it boils down to one idea: every part of your chain must agree on a practical sample rate. Once your project, device, host, and operating system share that single number, Audacity usually records without complaint and lets you focus on your music, podcasts, or voice work instead of settings screens.
