Ignore:
Timestamp:
Mar 15, 2006 8:56:04 PM (18 years ago)
Author:
bennylp
Message:

Tidying up sound device, register PortAudio? error codes, and initial support for stereo sound device (untested)

File:
1 edited

Legend:

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

    r188 r319  
    4949    unsigned    default_samples_per_sec;/**< Default sampling rate.         */ 
    5050} pj_snd_dev_info; 
    51  
    52 /** 
    53  * Sound device parameter, to be specified when calling #pj_snd_open_recorder 
    54  * or #pj_snd_open_player. 
    55  */ 
    56 typedef struct pj_snd_stream_info 
    57 { 
    58     unsigned samples_per_sec;           /**< Sampling rate.             */ 
    59     unsigned bits_per_sample;           /**< No of bits per sample.     */ 
    60     unsigned samples_per_frame;         /**< No of samples per frame.   */ 
    61     unsigned bytes_per_frame;           /**< No of bytes per frame.     */ 
    62     unsigned frames_per_packet;         /**< No of frames per packet.   */ 
    63 } pj_snd_stream_info; 
    6451 
    6552/**  
     
    135122 * @return              Audio stream, or NULL if failed. 
    136123 */ 
    137 PJ_DECL(pj_snd_stream*) pj_snd_open_recorder(int index, 
    138                                              const pj_snd_stream_info *param, 
    139                                              pj_snd_rec_cb rec_cb, 
    140                                              void *user_data); 
     124PJ_DECL(pj_status_t) pj_snd_open_recorder( int index, 
     125                                           unsigned clock_rate, 
     126                                           unsigned channel_count, 
     127                                           unsigned samples_per_frame, 
     128                                           unsigned bits_per_sample, 
     129                                           pj_snd_rec_cb rec_cb, 
     130                                           void *user_data, 
     131                                           pj_snd_stream **p_snd_strm); 
    141132 
    142133/** 
     
    151142 * @return              Audio stream, or NULL if failed. 
    152143 */ 
    153 PJ_DECL(pj_snd_stream*) pj_snd_open_player(int index, 
    154                                            const pj_snd_stream_info *param, 
    155                                            pj_snd_play_cb play_cb, 
    156                                            void *user_data); 
     144PJ_DECL(pj_status_t) pj_snd_open_player( int index, 
     145                                         unsigned clock_rate, 
     146                                         unsigned channel_count, 
     147                                         unsigned samples_per_frame, 
     148                                         unsigned bits_per_sample, 
     149                                         pj_snd_play_cb play_cb, 
     150                                         void *user_data, 
     151                                         pj_snd_stream **p_snd_strm ); 
    157152 
    158153/** 
Note: See TracChangeset for help on using the changeset viewer.