To convert an recorded audio file format, you can use a audio editing software that supports encoding. Here are the steps to convert an audio file to u-law format using the popular audio editing software Audacity:
1- Open Audacity and import the audio file you want to convert by selecting “File” > “Import” > “Audio”.
Click on the track you just imported to select it.
Adjust Audio Hz Rate
Select “File” > “Export” > “Export as wav”
In the “Save as type” dropdown, select “Encoding”.
In the “Header” dropdown, select “WAV (Microsoft) “.
In the “Encoding” dropdown, select “U-Law”, A-law, PCM, 64bit etc..
Click “Save” and a new dialog box will appear.
In the new dialog box click “OK”.
Finally, choose the location where you want to save the new u-law audio file and click “Save”.