星号 - 如何为音频文件添加书签

时间:2016-05-27 07:49:16

标签: java streaming asterisk

我需要书签音频文件流。

我如何流式传输文件但不能从0开始?比如从1分钟开始或类似的事情。 有人请给我一个提示。 编辑:我怎么能得到哪个部分播放的字节?因为Offset:偏移字节开始播放所以我需要获取书签的字节。

1 个答案:

答案 0 :(得分:0)

你有应用程序ControlPlayback允许使用偏移量进行播放。

pro-sip*CLI> core show application ControlPlayback 

  -= Info about application 'ControlPlayback' =- 

[Synopsis]
Play a file with fast forward and rewind. 

[Description]
This application will play back the given <filename>.
It sets the following channel variables upon completion:
${CPLAYBACKSTATUS}: Contains the status of the attempt as a text string
    SUCCESS
    USERSTOPPED
    ERROR
${CPLAYBACKOFFSET}: Contains the offset in ms into the file where playback
was at when it stopped. '-1' is end of file.
${CPLAYBACKSTOPKEY}: If the playback is stopped by the user this variable
contains the key that was pressed.

[Syntax]
ControlPlayback(filename[,skipms[,ff[,rew[,stop[,pause[,restart[,options]]]]]]])

[Arguments]
skipms
    This is number of milliseconds to skip when rewinding or fast-fo
    rwarding.
ff
    Fast-forward when this DTMF digit is received. (defaults to '#')
rew
    Rewind when this DTMF digit is received. (defaults to '*')
stop
    Stop playback when this DTMF digit is received.
pause
    Pause playback when this DTMF digit is received.
restart
    Restart playback when this DTMF digit is received.
options
    o(time): 
        time - Start at <time> ms from the beginning of the file.



[See Also]
Not available