Search code examples
audiomp3asteriskplayback

MP3Player() function pauses for 2 seconds after sound play and then executes next command


I am using asterisk 11 and created a small dialplan of playing a sound file then taking input from user

part of my code

exten => _X.,1,Answer()
same => n,MP3Player(/sound.mp3)
same => n,Read(NUMBER,,4,5)

My problem is that the asterisk after playing sound.mp3 pauses for 2 seconds and then executes the next read function.So if i enter just after sound play read function not able to recognise it.Ive checked the sound file and it doest have any gape after tone played.

Is there any solution for this. Thanks


Solution

  • Very likly that mean you sound have 2 second silence at end.

    You also can use

    same => n,Read(NUMBER,/sound,4,5)
    

    Need have asterisk with mp3 support module compiled in.

    Best option actualy convert your mp3 to wav 16 bit mono pcm wav and use that file, not mp3.