# Convert mp3 into wave

**URL:** <https://community.asterisk.org/t/convert-mp3-into-wave/73063>\
**Category:** Asterisk Support\
**Created:** [December 28, 2017, 3:01pm UTC](https://community.asterisk.org/t/convert-mp3-into-wave/73063 "2017-12-28T15:01:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![asteriskpath](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@asteriskpath](https://community.asterisk.org/u/asteriskpath)\
**Post date:** [December 28, 2017, 3:01pm UTC](https://community.asterisk.org/t/convert-mp3-into-wave/73063/1 "2017-12-28T15:01:15Z")

</div>

Hi I have to play mp3 file in dialplan…

1. Can I directly play mp3 in asterisk?
2. Do I need to convert into .wav
3. If need to convert into .wav then can I convert in dial-plan only through below command

sox foo-in.wav -r 8000 -c 1 -s -w foo-out.wav resample -ql

---

<div class="post-metadata">

**Author:** ![GuilhermeBiz](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/guilhermebiz/32/2977_2.png) [@GuilhermeBiz](https://community.asterisk.org/u/GuilhermeBiz)\
**Post date:** [December 28, 2017, 3:11pm UTC](https://community.asterisk.org/t/convert-mp3-into-wave/73063/2 "2017-12-28T15:11:25Z")

</div>

You can convert the mp3 into wav using an AGI, then use the .wav in your dialplan  
Start your agi by using

> #!/bin/bash

So you can execute bash scripts

---

<div class="post-metadata">

**Author:** ![ambiorixg12](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/ambiorixg12/32/1887_2.png) [@ambiorixg12](https://community.asterisk.org/u/ambiorixg12)\
**Post date:** [December 28, 2017, 3:12pm UTC](https://community.asterisk.org/t/convert-mp3-into-wave/73063/3 "2017-12-28T15:12:19Z")

</div>

This one work for me sox input-file.mp3 -c1 -r 8000 output-file.wav

---

<div class="post-metadata">

**Author:** ![johnkiniston](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/johnkiniston/32/28_2.png) [@johnkiniston](https://community.asterisk.org/u/johnkiniston)\
**Post date:** [December 28, 2017, 5:23pm UTC](https://community.asterisk.org/t/convert-mp3-into-wave/73063/4 "2017-12-28T17:23:10Z")

</div>

format\_mp3 from the Add-ons in menuselect can read mp3’s.

---

<div class="post-metadata">

**Author:** ![asteriskpath](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@asteriskpath](https://community.asterisk.org/u/asteriskpath)\
**Post date:** [December 29, 2017, 6:50am UTC](https://community.asterisk.org/t/convert-mp3-into-wave/73063/5 "2017-12-29T06:50:49Z")

</div>

while I run this command getting below error

sox formats: no handler for file extension `mp3’

---

<div class="post-metadata">

**Author:** ![ambiorixg12](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/ambiorixg12/32/1887_2.png) [@ambiorixg12](https://community.asterisk.org/u/ambiorixg12)\
**Post date:** [December 29, 2017, 3:26pm UTC](https://community.asterisk.org/t/convert-mp3-into-wave/73063/6 "2017-12-29T15:26:23Z")

</div>

> [@asteriskpath](#):
>
> sox formats: no handler for file extension `mp3’

The sox version you have cant handle mp3 file, so you need to recopile sox with mp3 support or you might use lame, anyaway those packages are not asterisk related you can get help on their respective forums
