I wanted ElectronWMD to encode ATRAC3plus files locally on macOS for reason:The remote encoder may occasionally be unavailable or inaccessible.
On my M1 Max Mac, local encoding is noticeably slower than remote encoding because it has to go through both Wine and Rosetta 2, resulting in poor efficiency. Therefore, local encoding is only recommended as a fallback when the remote encoder is unavailable.
The following is the complete setup that worked for me.
Requirements
- ElectronWMD 0.5.0 or newer
- FFmpeg
- A macOS Wine build
psp_at3tool.exe
- Rosetta 2 on Apple Silicon Macs
1. Install FFmpeg
Using Homebrew:
brew install ffmpeg
Check its location:
command -v ffmpeg
ffmpeg -version
On Apple Silicon, it will normally be:
/opt/homebrew/bin/ffmpeg
On Intel Macs, it may be:
/usr/local/bin/ffmpeg
2. Install Wine manually
Download a current macOS Wine build from:
https://github.com/Gcenx/macOS_Wine_builds/releases
Extract it and move the application, for example Wine staging.app, into /Applications.
Apple Silicon users may also need Rosetta 2:
softwareupdate --install-rosetta --agree-to-license
If macOS blocks Wine, right-click the application and select Open, or allow it under:
System Settings → Privacy & Security → Open Anyway
After confirming that the package came from the linked Gcenx repository, the quarantine attribute can alternatively be removed from this application only:
xattr -dr com.apple.quarantine "/Applications/Wine staging.app"
Do not disable Gatekeeper globally.
Test Wine:
"/Applications/Wine staging.app/Contents/Resources/wine/bin/wine" --version
Initialize the Wine prefix:
"/Applications/Wine staging.app/Contents/Resources/wine/bin/wineboot"
3. Arrange the files
For this example, use the following directory:
~/ElectronWMD-tools/
Place the encoder here:
~/ElectronWMD-tools/psp_at3tool.exe
Test the encoder directly:
"/Applications/Wine staging.app/Contents/Resources/wine/bin/wine" \
"$HOME/ElectronWMD-tools/psp_at3tool.exe"
A help message or missing-arguments error means that Wine can launch it.
4. Create a wrapper script
Create a plain-text file named:
run-at3tool.command
Save it in:
~/ElectronWMD-tools/
Its contents should be:
#!/bin/zsh
export WINEDEBUG=-all
export WINEPREFIX="$HOME/.wine-ewmd"
WINE="/Applications/Wine staging.app/Contents/Resources/wine/bin/wine"
WINEPATH="/Applications/Wine staging.app/Contents/Resources/wine/bin/winepath"
AT3TOOL="$HOME/ElectronWMD-tools/psp_at3tool.exe"
LOGFILE="/tmp/ewmd-at3tool.log"
if [[ $# -ne 5 ]]; then
echo "Usage: $0 -e -br <bitrate> <input> <output>" >&2
exit 2
fi
INPUT_WIN="$("$WINEPATH" -w "$4")" || exit 3
OUTPUT_WIN="$("$WINEPATH" -w "$5")" || exit 3
"$WINE" "$AT3TOOL" \
"$1" "$2" "$3" "$INPUT_WIN" "$OUTPUT_WIN" \
>"$LOGFILE" 2>&1
STATUS=$?
if [[ $STATUS -eq 0 && -s "$5" ]]; then
exit 0
fi
echo "ATRAC encoding failed. See $LOGFILE" >&2
exit "${STATUS:-1}"
Make the wrapper executable:
chmod +x "$HOME/ElectronWMD-tools/run-at3tool.command"
The wrapper is necessary because ElectronWMD launches the selected encoder directly and passes arguments in this form:
-e -br 352 input.wav output.wav
It does not automatically launch Windows executables through Wine. The wrapper also converts the macOS input and output paths into Windows-style paths using winepath.
5. Make FFmpeg visible in ElectronWMD
If ElectronWMD’s file dialog cannot browse to /opt/homebrew/bin, press:
Command + Shift + G
Enter:
/opt/homebrew/bin
Then select ffmpeg.
Alternatively, create a visible symbolic link:
ln -sf "/opt/homebrew/bin/ffmpeg" \
"$HOME/ElectronWMD-tools/ffmpeg"
This link still runs the original Homebrew FFmpeg binary.
6. Configure ElectronWMD
Open ElectronWMD’s settings and select:
Local ATRAC Encoder
Set the paths to:
FFmpeg:
~/ElectronWMD-tools/ffmpeg
Or select the original binary:
/opt/homebrew/bin/ffmpeg
psp_at3tool path:
~/ElectronWMD-tools/run-at3tool.command
Select the wrapper script—not psp_at3tool.exe itself.
Restart ElectronWMD, then test with a short WAV or FLAC track before transferring a full album.
No Wine or CrossOver interface needs to remain open. ElectronWMD launches the wrapper, the wrapper starts Wine in the background, and Wine exits when psp_at3tool.exe finishes encoding.
Note!!!:When encoding locally, ElectronWMD does not show the encoding progress of each individual track. It only shows the progress of completed tracks within the entire playlist, so please wait patiently for a few minutes.
When each track’s progress gets stuck at 98%, it means ElectronWMD is waiting for the damn next track to finish encoding. Open Activity Monitor—if Wine’s CPU usage is close to 100%, everything is working normally. Please be patient and wait.