In order to convert m4a to wav, we can use python pydub.
However, if you can not install python pydub in your system, how to convert? In this tutorial, we will introduce you how to use ffmpeg to convert m4a to wav directly.
If you are using linux system, you can install ffmpeg offline as follows:
View audio information
In order to conver to m4a to wav correctly, we should know the sample rate, mono or stereo. We can use ffprobe to check them.
Use ffmpeg to convert m4a to wav
We can use ffmpeg command to convert. Here is a command example:
ffmpeg -i m4a_file_name -ar sample_rate -ac channel_num -f wav wav_file_name
sample_rate: the sample rate of wav_file_name, it can be 8000, 16000 et al.
channel_num: the channel num of wav_file_name, we often keep the channel num of m4a_file_name and wav_fle_name same
Here is an example:
ffmpeg -i test.m4a -ar 8000 -ac 1 -f wav test.wav
Moreover, we also can use python subprocess to execute this command using python script. Here is the tutorial: