Ignore:
Timestamp:
Mar 24, 2006 8:41:20 PM (18 years ago)
Author:
bennylp
Message:

Added WAVE writer and resample port, and also found out why audio quality is poor with DirectSound?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia/resample.h

    r277 r358  
    2626 * @brief Sample rate converter. 
    2727 */ 
    28 #include "pjmedia/types.h" 
     28#include <pjmedia/types.h> 
     29#include <pjmedia/port.h> 
     30 
    2931 
    3032PJ_BEGIN_DECL 
     33 
     34/* 
     35 * This file declares two types of API: 
     36 * 
     37 * Application can use #pjmedia_resample_create() and #pjmedia_resample_run() 
     38 * to convert a frame from source rate to destination rate. The inpuit frame  
     39 * must have a constant length. 
     40 * 
     41 * Alternatively, application can create a resampling port with 
     42 * #pjmedia_resample_port_create() and connect the port to other ports to 
     43 * change the sampling rate of the samples. 
     44 */ 
     45 
    3146 
    3247/** 
     
    6075 
    6176/** 
    62  * Resample a frame. 
     77 * Use the resample session to resample a frame. The frame must have the 
     78 * same size and settings as the resample session, or otherwise the 
     79 * behavior is undefined. 
    6380 * 
    6481 * @param resample              The resample session. 
     
    7188 
    7289 
     90/** 
     91 * Get the input frame size of a resample session. 
     92 * 
     93 * @param resample              The resample session. 
     94 * 
     95 * @return                      The frame size, in number of samples. 
     96 */ 
     97PJ_DECL(unsigned) pjmedia_resample_get_input_size(pjmedia_resample *resample); 
     98 
     99 
     100/** 
     101 * Create a resample port. This creates a bidirectional resample session, 
     102 * which will resample frames when the port's get_frame() and put_frame() 
     103 * is called. 
     104 * 
     105 * When the resample port's get_frame() is called, this port will get 
     106 * a frame from the downstream port and resample the frame to the upstream 
     107 * port's clock rate before returning it to the caller. 
     108 * 
     109 * When the resample port's put_frame() is called, this port will resample 
     110 * the frame to the downstream's port clock rate before giving the frame 
     111 * to the downstream port. 
     112 * 
     113 * @param pool                  Pool to allocate the structure and buffers. 
     114 * @param high_quality          If true, then high quality conversion will be 
     115 *                              used, at the expense of more CPU and memory, 
     116 *                              because temporary buffer needs to be created. 
     117 * @param large_filter          If true, large filter size will be used. 
     118 * @param downstream_rate       The sampling rate of the downstream port. 
     119 * @param upstream_rate         The sampling rate of the upstream port. 
     120 * @param channel_count         The number of channels. This argument is only 
     121 *                              used for the port information. It does not 
     122 *                              change the behavior of the resample port. 
     123 * @param samples_per_frame     Number of samples per frame from the downstream 
     124 *                              port. 
     125 * @param p_port                Pointer to receive the resample port instance. 
     126 * 
     127 * @return PJ_SUCCESS on success. 
     128 */ 
     129PJ_DECL(pj_status_t) pjmedia_resample_port_create( pj_pool_t *pool, 
     130                                                   pj_bool_t high_quality, 
     131                                                   pj_bool_t large_filter, 
     132                                                   unsigned downstream_rate, 
     133                                                   unsigned upstream_rate, 
     134                                                   unsigned channel_count, 
     135                                                   unsigned samples_per_frame, 
     136                                                   pjmedia_port **p_port ); 
     137 
     138 
    73139PJ_END_DECL 
    74140 
Note: See TracChangeset for help on using the changeset viewer.