音源操作メモ
![](https://objectstorage.ap-tokyo-1.oraclecloud.com/n/nramgbr2svc9/b/poppo-ya/o/wp-content/uploads/2024/03/hato8847_simple_thin_line_illustration_a_silhouette_of_working__cd36f522-3f4c-4091-90d2-a50e6ffb4175.png)
忘れないようにまとめ。
m4a を wav に変換
MacOSに標準でinstallされているコマンド afconvert(Audio File Convert)
を利用する。
afconvert -f WAVE -d LEI16 -c 2 input.m4a output.wav
wav を mp3 に変換
sox output.wav output.mp4
RPi Pico のStorageにMacからアクセスする準備
#!/bin/sh
#
# This works around bug where, by default, macOS 14.x writes part of a file
# immediately, and then doesn't update the directory for 20-60 seconds, causing
# the file system to be corrupted.
#
disky=`df | grep CIRCUITPY | cut -d" " -f1`
sudo umount /Volumes/CIRCUITPY
sudo mkdir /Volumes/CIRCUITPY
sleep 2
sudo mount -v -o noasync -t msdos $disky /Volumes/CIRCUITPY
音量を上げる
sox input.wav output.wav gain -l 10
RPi Pico 用に変換
sox input.wav -r 16000 -c 1 -e signed-integer output.wav