[asterisk-dev] How to create a slinear silent frame?

Russell Bryant russell at digium.com
Mon May 18 11:43:11 CDT 2009


Kaloyan Kovachev wrote:
>> If you need frame level access to a beep, your best bet is to use the
>> file stream API.  You can open a beep sound file with ast_openstream()
>> and then call ast_readframe() to get each frame.
> 
> ast_openstream() requires a channel ... is it possible to open a filestream in
> SLINEAR without the need for a channel?

You're right, it requires a channel.

If you do not have a channel, you can open a file stream with
ast_readfile().  res/res_convert.c is an example of a module that opens
a sound file and reads from it without a channel.  It also uses
ast_writefile() to open a file to write audio to without a channel.

-- 
Russell Bryant
Digium, Inc. | Senior Software Engineer, Open Source Team Lead
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list