# File format priority in playback

**URL:** <https://community.asterisk.org/t/file-format-priority-in-playback/86154>\
**Category:** Asterisk Support\
**Created:** [October 21, 2020, 2:47pm UTC](https://community.asterisk.org/t/file-format-priority-in-playback/86154 "2020-10-21T14:47:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![eyalhasson](https://avatars.discourse-cdn.com/v4/letter/e/eb9ed0/32.png) [@eyalhasson](https://community.asterisk.org/u/eyalhasson)\
**Post date:** [October 21, 2020, 2:47pm UTC](https://community.asterisk.org/t/file-format-priority-in-playback/86154/1 "2020-10-21T14:47:20Z")

</div>

Hello,

I have cases when the same prompt for playback exist in multiple formats (like ulaw, sln etc). Is there a way to know which format will Asterisk pick? Can I set the order of priority?

Thanks,

---

<div class="post-metadata">

**Author:** ![david551](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@david551](https://community.asterisk.org/u/david551)\
**Post date:** [October 21, 2020, 3:53pm UTC](https://community.asterisk.org/t/file-format-priority-in-playback/86154/2 "2020-10-21T15:53:39Z")

</div>

The one with the lowest cost in “core show translations”, given the target codec.

The order is fixed by the computed cost of the translation.

---

<div class="post-metadata">

**Author:** ![eyalhasson](https://avatars.discourse-cdn.com/v4/letter/e/eb9ed0/32.png) [@eyalhasson](https://community.asterisk.org/u/eyalhasson)\
**Post date:** [October 21, 2020, 5:16pm UTC](https://community.asterisk.org/t/file-format-priority-in-playback/86154/3 "2020-10-21T17:16:59Z")

</div>

I see. That’s make life complecated… If my core show channel xxx shows the following, what is the base codec, g722 or alaw?  
NativeFormats: (alaw)  
WriteFormat: g722  
ReadFormat: alaw

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [October 21, 2020, 5:23pm UTC](https://community.asterisk.org/t/file-format-priority-in-playback/86154/4 "2020-10-21T17:23:44Z")

</div>

The base codec, that is going out over the wire, is g722.

---

<div class="post-metadata">

**Author:** ![eyalhasson](https://avatars.discourse-cdn.com/v4/letter/e/eb9ed0/32.png) [@eyalhasson](https://community.asterisk.org/u/eyalhasson)\
**Post date:** [October 21, 2020, 5:52pm UTC](https://community.asterisk.org/t/file-format-priority-in-playback/86154/5 "2020-10-21T17:52:06Z")

</div>

So, in the case bellow, the codec used over the wire is adpcm? And what is the meaning of the tanslation chain here?

NativeFormats: (alaw)  
WriteFormat: adpcm  
ReadFormat: alaw  
WriteTranscode: Yes (adpcm@8000)-\>(slin@8000)-\>(alaw@8000)

Thanks.

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [October 21, 2020, 6:09pm UTC](https://community.asterisk.org/t/file-format-priority-in-playback/86154/6 "2020-10-21T18:09:24Z")

</div>

Sorry, I thought I typed alaw instead of g722. Yeesh, one of those days. Here’s the key for information:

NativeFormats = what is going out over the wire  
WriteFormat = what the current application or what is handling the channel is providing, which is translated to native format  
ReadFormat = what the current application or what is handling the channel is expecting, which is translated from native format

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [November 20, 2020, 6:09pm UTC](https://community.asterisk.org/t/file-format-priority-in-playback/86154/7 "2020-11-20T18:09:30Z")

</div>

Closed on November 20, 2020, 6:09pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
