blob: 3bb4c1bc276762a0d2cdff04cf444acf0fcef695 [file] [log] [blame]
luojiana6a47a92024-05-23 13:42:21 +08001
liubin281ac462023-07-19 14:22:54 +08002#include "ql/ql_audio.h"
3#include "mbtk_log.h"
luojiana6a47a92024-05-23 13:42:21 +08004#include "mbtk_audio2.h"
liubin281ac462023-07-19 14:22:54 +08005
b.liuc181beb2024-03-07 18:34:21 +08006typedef enum {
7 AUDIO_PLAY_STATE_STOP,
8 AUDIO_PLAY_STATE_RUNNING,
9 AUDIO_PLAY_STATE_PAUSE
10} audio_play_state_enum;
b.liu5fa9e772023-11-23 18:00:55 +080011
b.liuc181beb2024-03-07 18:34:21 +080012#define AUDIO_HANDLE 1
13#define WAV_PLAY_BUFF 1024
14
luojianfee10dc2024-07-25 11:34:35 +080015
16static mbtk_audio_handle player_hdl = NULL;
17static _cb_onRecorder record_cb_fun = NULL;
18static int Samprate = 8000;
19
20
b.liuc181beb2024-03-07 18:34:21 +080021static int sample_rate = 8000;
22static int play_handle = AUDIO_HANDLE;
23static _cb_onPlayer play_cb_func = NULL;
24static _cb_onRecorder recorder_cb_fun = NULL;
25static int is_running = 0;
26static audio_play_state_enum play_state = AUDIO_PLAY_STATE_STOP;
27static int play_exit = 1;
28
29static void recorder_cb_func(void *data, uint32 data_len)
30{
31 if(recorder_cb_fun) {
32 recorder_cb_fun(AUD_RECORDER_START, (unsigned char*)data, data_len);
33 }
34}
35
36static int play_stream(unsigned char* pData, unsigned int length)
37{
38 int rc, len, frames = 0;
39 int result = 0;
40
41 play_state = AUDIO_PLAY_STATE_RUNNING;
42 play_exit = 0;
43 int data_send = 0;
44
luojiana6a47a92024-05-23 13:42:21 +080045 if (mbtk_audio_pcm_play_start()) {
46 printf("%s: error opening output device.", __FUNCTION__);
47 return -1;
48 }
49
b.liuc181beb2024-03-07 18:34:21 +080050 if(pData && length > 0) {
51 while (play_state != AUDIO_PLAY_STATE_STOP) {
52 if(play_state == AUDIO_PLAY_STATE_RUNNING) {
53 if (data_send >= length) {
54 LOGE("%s: Read pcm stream end.", __FUNCTION__);
55 break;
56 }
57
58 if(length - data_send > WAV_PLAY_BUFF) {
59 len = WAV_PLAY_BUFF;
60 } else {
61 len = length - data_send;
62 }
63
64 if((rc = mbtk_audio_pcm_play_data_send(pData + data_send, len)) != len) {
65 LOGE("Send data %d/%d", rc, len);
66 result = -1;
67 goto thread_end;
68 }
69
70 data_send += len;
71
72 LOGD("%s: No.%d frame playback", __FUNCTION__, ++frames);
73 } else {
74 usleep(200000);
75 }
76 }
77 } else {
78 result = -1;
79 }
80
81 play_state = AUDIO_PLAY_STATE_STOP;
82
luojian21604d92024-06-25 14:11:25 +080083
b.liuc181beb2024-03-07 18:34:21 +080084thread_end:
85 mbtk_audio_pcm_play_stop();
86 play_exit = 1;
87 LOGD("%s: finished pcm playback.", __FUNCTION__);
88 return result;
89}
90
91static int play_by_fd(int fd, int offset)
92{
93 int rc, len, frames = 0;
94 int result = 0;
95 char buf[WAV_PLAY_BUFF];
96
97 play_state = AUDIO_PLAY_STATE_RUNNING;
luojian21604d92024-06-25 14:11:25 +080098 if(play_cb_func)
99 play_cb_func(play_handle , AUDIO_PLAY_STATE_RUNNING);
b.liuc181beb2024-03-07 18:34:21 +0800100 play_exit = 0;
101 if(fd > 0) {
102 if(offset > 0) {
103 lseek(fd, offset, SEEK_SET);
104 }
luojiana6a47a92024-05-23 13:42:21 +0800105
106 if (mbtk_audio_pcm_play_start()) {
107 printf("%s: error opening output device.", __FUNCTION__);
108 return -1;
109 }
110
111
b.liuc181beb2024-03-07 18:34:21 +0800112 while (play_state != AUDIO_PLAY_STATE_STOP) {
113 if(play_state == AUDIO_PLAY_STATE_RUNNING) {
114 memset(buf, 0x00, sizeof(buf));
115 len = read(fd, buf, WAV_PLAY_BUFF);
116 if (len == -1) {
117 LOGE("%s: error reading from file", __FUNCTION__);
118 result = -1;
119 goto thread_end;
120 }
121
122 if (len == 0) {
123 /* reached EOF */
124 LOGE("%s: Read wav file end.", __FUNCTION__);
125 break;
126 }
127
128 if((rc = mbtk_audio_pcm_play_data_send(buf, len)) < len) {
129 LOGE("Send data %d/%d", rc, len);
130 result = -1;
131 goto thread_end;
132 }
133
134 LOGD("%s: No.%d frame playback", __FUNCTION__, ++frames);
135 } else {
136 usleep(200000);
137 }
138 }
139 } else {
140 result = -1;
141 }
142
143 play_state = AUDIO_PLAY_STATE_STOP;
luojian21604d92024-06-25 14:11:25 +0800144 if(play_cb_func)
145 play_cb_func(play_handle , AUDIO_PLAY_STATE_STOP);
b.liuc181beb2024-03-07 18:34:21 +0800146
147thread_end:
148 mbtk_audio_pcm_play_stop();
149 play_exit = 1;
150 LOGD("%s: finished pcm playback.", __FUNCTION__);
151 return result;
152}
liubin281ac462023-07-19 14:22:54 +0800153
154/*****************************************************************
155* Function: Ql_AudPlayer_Open
156*
157* Description:
158* Open audio play device, and specify the callback function.
159* This function can be called twice to play different audio sources.
160*
161* Parameters:
162* device : a string that specifies the PCM device.
163* NULL, means the audio will be played on the default PCM device.
164*
165* If you want to mixedly play audio sources, you can call this
166* API twice with specifying different PCM device.
167* The string devices available:
168* "hw:0,0" (the default play device)
169* "hw:0,13" (this device can mix audio and TTS)
170* "hw:0,14"
171*
172* cb_func : callback function for audio player.
173* The results of all operations on audio player
174* are informed in callback function.
175*
176* Return:
177* pcm device handle on success
178* -1 for failure
179*****************************************************************/
180int Ql_AudPlayer_Open(char* device, _cb_onPlayer cb_func)
181{
luojianfee10dc2024-07-25 11:34:35 +0800182#ifdef MBTK_AF_SUPPORT
183 player_hdl = mbtk_audio_open_new(MBTK_AUTIO_TYPE_OUT, 1, Samprate, cb_func);
184 return (int)player_hdl;
185#else
b.liuc181beb2024-03-07 18:34:21 +0800186 if(is_running || mbtk_audio_pcm_init()) {
187 return -1;
188 } else {
189 play_cb_func = cb_func;
190 is_running = 1;
191 return play_handle;
192 }
luojianfee10dc2024-07-25 11:34:35 +0800193#endif
liubin281ac462023-07-19 14:22:54 +0800194}
195
196/*========================================================================
197 FUNCTION: Ql_AudPlayer_Play
198=========================================================================*/
199/** @brief
200 This function writes pcm data to pcm device to play.
201
202 @param[in] hdl, the handle returned by Ql_AudPlayer_Open().
203 @param[in] pData, pointer to the start address of pcm data.
204 @param[in] length, the length of pcm data.
205
206 @return
207 on success, the return value is the number of bytes to play
208 on failure, the return value is -1;
209
210 @dependencies
211 Ql_AudPlayer_Open() must be first called successfully.
212*/
213/*=======================================================================*/
214int Ql_AudPlayer_Play(int hdl, unsigned char* pData, unsigned int length)
215{
luojianfee10dc2024-07-25 11:34:35 +0800216#ifdef MBTK_AF_SUPPORT
217 return mbtk_audio_play_stream_new((void *)hdl, pData, length,50);
218
219#else
b.liuc181beb2024-03-07 18:34:21 +0800220 if(!is_running || hdl != play_handle) {
221 LOGE("Handle error : %d", hdl);
222 return -1;
223 }
224
225 return play_stream(pData, length);
luojianfee10dc2024-07-25 11:34:35 +0800226#endif
liubin281ac462023-07-19 14:22:54 +0800227}
228
229/*========================================================================
230 FUNCTION: Ql_AudPlayer_PlayFrmFile
231=========================================================================*/
232/** @brief
233 This function plays the pcm data from the specified file.
234
235 @param[in] hdl, the handle returned by Ql_AudPlayer_Open().
236 @param[in] fd, a file descriptor that contains pcm data.
237 Note:
238 the file offset should be set to the start position of pcm
239 data region, which means you should move the file offset
240 skipping the file header (such as wave header, amr header).
241 @param[in] offset, file offset. Please set it to -1 if no need to use.
242
243 @return
244 0 on success
245 -1 on failure
246
247 @dependencies
248 Ql_AudPlayer_Open() must be first called successfully.
249*/
250/*=======================================================================*/
zhangzh8711cea2023-10-20 10:47:43 +0800251
liubin281ac462023-07-19 14:22:54 +0800252int Ql_AudPlayer_PlayFrmFile(int hdl, int fd, int offset)
253{
luojianfee10dc2024-07-25 11:34:35 +0800254#ifdef MBTK_AF_SUPPORT
255 return mbtk_audio_play_file_new((void *)hdl, fd, offset);
256
257#else
b.liuc181beb2024-03-07 18:34:21 +0800258 if(!is_running || hdl != play_handle) {
259 LOGE("Handle error : %d", hdl);
260 return -1;
261 }
262
263 return play_by_fd(fd, offset);
luojianfee10dc2024-07-25 11:34:35 +0800264#endif
liubin281ac462023-07-19 14:22:54 +0800265}
266
267//
268// Function: Ql_AudPlayer_Pause
269//
270// Description:
271// Pause playing.
272// @param hdl:
273// Handle received from Ql_AudPlayer_Open().
274int Ql_AudPlayer_Pause(int hdl)
275{
b.liuc181beb2024-03-07 18:34:21 +0800276 if(!is_running || hdl != play_handle) {
277 LOGE("Handle error : %d", hdl);
278 return -1;
279 }
280
281 play_state = AUDIO_PLAY_STATE_PAUSE;
282
283 while(!play_exit) {
284 usleep(10000);
285 }
286
b.liu5fa9e772023-11-23 18:00:55 +0800287 return 0;
liubin281ac462023-07-19 14:22:54 +0800288}
289
290//
291// Function: Ql_AudPlayer_Resume
292//
293// Description:
294// Resume playing.
295// @param hdl:
296// Handle received from Ql_AudPlayer_Open().
297int Ql_AudPlayer_Resume(int hdl)
298{
b.liuc181beb2024-03-07 18:34:21 +0800299 if(!is_running || hdl != play_handle) {
300 LOGE("Handle error : %d", hdl);
301 return -1;
302 }
303
304 play_state = AUDIO_PLAY_STATE_RUNNING;
305
306 while(!play_exit) {
307 usleep(10000);
308 }
b.liu5fa9e772023-11-23 18:00:55 +0800309 return 0;
liubin281ac462023-07-19 14:22:54 +0800310}
311
312//
313// Function: Ql_AudPlayer_Stop
314//
315// Description:
316// Stop playing audio
317// hdl:
318// Handle received from Ql_AudPlayer_Open().
319void Ql_AudPlayer_Stop(int hdl)
320{
b.liuc181beb2024-03-07 18:34:21 +0800321 if(!is_running || hdl != play_handle) {
322 LOGE("Handle error : %d", hdl);
323 return;
324 }
b.liu5fa9e772023-11-23 18:00:55 +0800325
b.liuc181beb2024-03-07 18:34:21 +0800326 play_state = AUDIO_PLAY_STATE_STOP;
327
328 while(!play_exit) {
329 usleep(10000);
330 }
liubin281ac462023-07-19 14:22:54 +0800331}
332
333//
334// Function: Ql_AudPlayer_Close
335//
336// Description:
337// Close player, and free the resource.
338// @param hdl:
339// Handle received from Ql_AudPlayer_Open().
340void Ql_AudPlayer_Close(int hdl)
341{
luojianfee10dc2024-07-25 11:34:35 +0800342 mbtk_audio_close_new((void *)hdl);
343
344
345#if 0
b.liuc181beb2024-03-07 18:34:21 +0800346 if(!is_running || hdl != play_handle) {
347 LOGE("Handle error : %d", hdl);
348 return;
349 }
350 play_state = AUDIO_PLAY_STATE_STOP;
b.liu5fa9e772023-11-23 18:00:55 +0800351
b.liuc181beb2024-03-07 18:34:21 +0800352 while(!play_exit) {
353 usleep(10000);
354 }
355
356 is_running = 0;
357 mbtk_audio_pcm_deinit();
luojianfee10dc2024-07-25 11:34:35 +0800358#endif
liubin281ac462023-07-19 14:22:54 +0800359}
360
361
362int Ql_AudPlayer_set_LessDataThreshold(int hdl, unsigned short threshSize)
363{
364
365 return 0;
366}
367
368int Ql_AudPlayer_get_freeSpace(int hdl)
369{
370
371 return 0;
372}
373
374
375/*****************************************************************
376* Function: Ql_AudRecorder_Open
377*
378* Description:
379* Open audio record device, and specify the callback function.
380*
381* Parameters:
382* device : not used. MUST be NULL.
383*
384* cb_func : callback function for audio player.
385* The results of all operations on audio recorder
386* are informed in callback function.
387*
388* Return:
389* pcm device handle
390* -1 for failure
391*****************************************************************/
392int Ql_AudRecorder_Open(char* device, _cb_onRecorder cb_fun)
393{
b.liuc181beb2024-03-07 18:34:21 +0800394 if(is_running || mbtk_audio_pcm_init()) {
395 return -1;
396 } else {
397 is_running = 1;
398 recorder_cb_fun = cb_fun;
399 return play_handle;
400 }
liubin281ac462023-07-19 14:22:54 +0800401}
402
403//
404// Function: Ql_AudRecorder_StartRecord
405//
406// Description:
407// Start to record.
408// The record data is output in _cb_onRecorder.
409//
410// Return:
411// 0 on success
412// -1 on failure
413int Ql_AudRecorder_StartRecord(void)
414{
b.liuc181beb2024-03-07 18:34:21 +0800415 if(!is_running) {
416 LOGE("No open device.");
417 return -1;
418 }
b.liu5fa9e772023-11-23 18:00:55 +0800419
b.liuc181beb2024-03-07 18:34:21 +0800420 return mbtk_audio_pcm_recorder_start(recorder_cb_func);
liubin281ac462023-07-19 14:22:54 +0800421}
422
423//
424// Function: Ql_AudRecorder_Pause
425//
426// Description:
427// Pause recording
428int Ql_AudRecorder_Pause(void)
429{
b.liuc181beb2024-03-07 18:34:21 +0800430 if(!is_running) {
431 LOGE("No open device.");
432 return -1;
433 }
434
435 return mbtk_audio_pcm_recorder_pause();
liubin281ac462023-07-19 14:22:54 +0800436}
437
438//
439// Function: Ql_AudRecorder_Resume
440//
441// Description:
442// Resume recording
443int Ql_AudRecorder_Resume(void)
444{
b.liuc181beb2024-03-07 18:34:21 +0800445 if(!is_running) {
446 LOGE("No open device.");
447 return -1;
448 }
449
450 return mbtk_audio_pcm_recorder_resume();
liubin281ac462023-07-19 14:22:54 +0800451}
452
453//
454// Function: Ql_AudRecorder_Stop
455//
456// Description:
457// Stop recording
458void Ql_AudRecorder_Stop(void)
459{
b.liuc181beb2024-03-07 18:34:21 +0800460 if(!is_running) {
461 LOGE("No open device.");
462 return;
463 }
liubin281ac462023-07-19 14:22:54 +0800464
b.liuc181beb2024-03-07 18:34:21 +0800465 mbtk_audio_pcm_recorder_stop();
liubin281ac462023-07-19 14:22:54 +0800466}
467
468//
469// Function: Ql_AudRecorder_Close
470//
471// Description:
472// Close recorder, and free the resource
473void Ql_AudRecorder_Close(void)
474{
b.liuc181beb2024-03-07 18:34:21 +0800475 if(!is_running) {
476 LOGE("No open device.");
477 return;
478 }
b.liu5fa9e772023-11-23 18:00:55 +0800479
b.liuc181beb2024-03-07 18:34:21 +0800480 is_running = 0;
481 mbtk_audio_pcm_deinit();
liubin281ac462023-07-19 14:22:54 +0800482}
483
484//
485// Function: Ql_clt_set_mixer_value
486//
487// Description:
488// Close recorder, and free the resource
489boolean Ql_clt_set_mixer_value(const char *device, int count, const char *value)
490{
491
492 return FALSE;
493}
494
495
496int Ql_AudTone_Open(char* device, _cb_onPlayer cb)//cb not support now
497{
498 return 0;
499}
500
501int Ql_AudTone_Start(int hdl, struct Ql_TonePara *para)
502{
503 return 0;
504}
505
506void Ql_AudTone_Stop(int hdl)
507{
508
509}
510
511void Ql_AudTone_Close(int hdl)
512{
513
514}
515
516
517//****************QL Codec API************************//
518
519//
520// Function: Ql_AudCodec_Set_ALC5616_DRCAGC
521//
522// Description:
523// Set ALC5616 DRC/AGC configuration
524int Ql_AudCodec_Set_ALC5616_DRCAGC(const char *i2c, struct Ql_ALC5616_DRCAGC *cfg)
525{
526 return 0;
527}
528
529//
530// Function: Ql_Update_wav_size
531//
532// Description:
533// update wav format file size in the header
534// @param fd:
535// wav file discriptor
536// @param size:
537// wav file size to update
538int Ql_Update_wav_size(int fd, int size)
539{
540 return 0;
541}
542
543//add by grady, 2018-5-29
544/*
545 * describe : this function is use to open pcm device
546 * paras :
547 * device : this should be fix to hw:0,0
548 * flags ; pcm play flags
549 * rate: sample rate
550 * channels : audio channal 1 or 2
551 * format: format to play or record, 16bit line,MP3
552 * hostless: if there is no file it is true
553 * return :
554 * pcm : pcm handle, use can use this handle to read write data
555 */
556struct pcm *quec_pcm_open(char *device, unsigned flags, unsigned rate, unsigned channels, unsigned format, unsigned hostless)
557{
558 return NULL;
559}
560
561/*
562 * describe : this function is use to close pcm handle
563 * paras :
564 * pcm : pcm handle to close
565 * return :
566 */
567int quec_pcm_close(struct pcm *pcm )
568{
569 return 0;
570}
571
572/*
573 * describe : this function is use to read pcm buffer
574 * paras :
575 * pcm : pcm handle to write date
576 * buffer: data buffer
577 * lenth: data length
578 * return :
579 */
580int quec_read_pcm(struct pcm *pcm, void * buffer, int length)
581{
582
583 return 0;
584}
585
586/*
587 * describe : this function is use to get pcm buffer lenth
588 * paras :
589 * lenth: data length
590 * return
591 * buffer length
592 */
593int quec_get_pem_buffer_len(struct pcm *pcm)
594{
595
596 return 0;
597}
598
599void dtmf_cb1(char dtmf)
600{
601 printf("%s:%c\n", __FUNCTION__, dtmf);
602}
603
604/**
605 * @brief Set RX DSP Gain
606 * @details
607 * Gain support [-36,12] dB
608 *
609 * @param gain
610 * DSP gain
611 */
612
613int Ql_Rxgain_Set(int value)
614{
luojianfee10dc2024-07-25 11:34:35 +0800615#ifdef MBTK_AF_SUPPORT
616 int volume =0;
617 if(value < -36 || value > 9)
618 {
619 volume = 0;
620 }
621 else
622 {
623 volume = value;
624 }
625
626 if(player_hdl==NULL)
627 return 0;
628
629 char databuf[1025]={0};
630 memcpy(databuf, " ", 1024);
631
632 mbtk_audio_play_stream_new(player_hdl, databuf, 1024, volume);
633 return 0;
634#else
luojiana6a47a92024-05-23 13:42:21 +0800635 mbtk_dsp_gain_set(1, value);
b.liu5fa9e772023-11-23 18:00:55 +0800636 return 0;
luojianfee10dc2024-07-25 11:34:35 +0800637#endif
638 return 0;
liubin281ac462023-07-19 14:22:54 +0800639}
640
641
642/** Ql_Playback_Samprate_Set
643 * @brief Set Playback PCM Samprate
644 * @details
645 * 0 for NB 1 for WB
646 *
647 * @param samprate
648 * samprate for PCM playback,default value is PCM NB
649 */
650int Ql_Playback_Samprate_Set(int samprate)
651{
652 printf("samprate is %d \n",samprate);
653 if(samprate == 1)
654 {
b.liuc181beb2024-03-07 18:34:21 +0800655 sample_rate = 16000;
luojiana6a47a92024-05-23 13:42:21 +0800656 mbtk_audio_pcm_sample_rate_set(MBTK_AUDIO_SAMPLE_RATE_16000);
liubin281ac462023-07-19 14:22:54 +0800657 }
658 else{
luojiana6a47a92024-05-23 13:42:21 +0800659 mbtk_audio_pcm_sample_rate_set(MBTK_AUDIO_SAMPLE_RATE_8000);
b.liuc181beb2024-03-07 18:34:21 +0800660 sample_rate = 8000;
liubin281ac462023-07-19 14:22:54 +0800661 }
662
663 return 0;
664}
665
666int Ql_Mp3_To_Wav(const char *wavpath, char *mp3path)
667{
b.liuc1064f82023-10-11 16:47:39 +0800668 return 0;
liubin281ac462023-07-19 14:22:54 +0800669}
670
671int Ql_Mp3_To_Play(char *mp3path, int hdl,int sample_rate)
672{
b.liuc1064f82023-10-11 16:47:39 +0800673 return 0;
liubin281ac462023-07-19 14:22:54 +0800674}
675
676//add by grady, 2018-6-2
677/*
678 * describe : this function is use to open mixer device
679 * paras :
680 * device: mixer device
681 * return
682 * mixer handle
683 */
684struct mixer *quec_mixer_open(const char *device)
685{
686
687 return NULL;
688}
689
690/*
691 * describe : this function is use to close mixer device
692 * paras :
693 * mixer: mixer handle
694 * return
695 * none
696 */
697void quec_mixer_close(struct mixer *mixer)
698{
699
700
701}
702
703/*
704 * describe : this function is use to get mixer devie control
705 * paras :
706 * mixer: mixer handle
707 * name: mixer device
708 * index: mixer index
709 * return
710 * mixer control
711 */
712struct mixer_ctl *quec_mixer_get_control(struct mixer *mixer, const char *name, unsigned index)
713{
714
715 return NULL;
716}
717
718/*
719 * describe : this function is use to set mulvalues
720 * paras :
721 * mixer: mixer handle
722 * count: count
723 * argv: data
724 * return :
725 *
726 */
727int quec_mixer_ctl_mulvalues(struct mixer_ctl *ctl, int count, char ** argv)
728{
729
730 return 0;
731}
732
733
734//end grady
735
736/*****************************************************************
737* Function: Ql_AudPlayer_OpenExt
738*
739* Description:
740* expend function from Ql_AudPlayer_OpenExt
741* Open audio play device, and specify the callback function.
742* This function can be called twice to play different audio sources.
743*
744* Parameters:
745* device : a string that specifies the PCM device.
746* NULL, means the audio will be played on the default PCM device.
747*
748* If you want to mixedly play audio sources, you can call this
749* API twice with specifying different PCM device.
750* The string devices available:
751* "hw:0,0" (the default play device)
752* "hw:0,13" (this device can mix audio and TTS)
753* "hw:0,14"
754*
755* cb_func : callback function for audio player.
756* The results of all operations on audio player
757* are informed in callback function.
758*
759* flags : pcm flags, eg: PCM_MMAP, PCM_NMMAP.
760*
761* channels: pcm sample channels.
762*
763* rate : pcm sample rate.
764*
765* format : pcm sample fromat
766*
767* Return:
768* pcm device handle
769* NULL, fail
770*****************************************************************/
771int Ql_AudPlayer_OpenExt(
772 char *dev,
773 _cb_onPlayer cb_fun,
774 int flags,
775 int channels,
776 int rate,
777 int format)
778{
779 return 0;
780}
781
782/*****************************************************************
783* Function: Ql_AudRecorder_Open
784*
785* Description:
786* Open audio record device, and specify the callback function.
787*
788* Parameters:
789* device : not used. MUST be NULL.
790*
791* cb_func : callback function for audio player.
792* The results of all operations on audio recorder
793* are informed in callback function.
794*
795* flags : pcm flags, eg: PCM_MMAP, PCM_NMMAP.
796*
797* channels: pcm sample channels.
798*
799* rate : pcm sample rate.
800*
801* format : pcm sample fromat
802*
803* Return:
804* pcm device handle
805* NULL, fail
806*****************************************************************/
807int Ql_AudRecorder_OpenExt(
808 char *dev,
809 _cb_onRecorder cb_fun,
810 int flags,
811 int channels,
812 int rate,
813 int format)
814{
815
816
817 return 0;
818}
819
820/*
821* Function: uac enable
822*
823* Description:
824* uac enable
825*
826* Parameters:
827* none
828* Return:
829* TURE or FALSE
830*/
831int ql_uac_enable(void)
832{
833
834 return 0;
835}
836
837/*
838* Function: uac disable
839*
840* Description:
841* uac disable
842*
843* Parameters:
844* none
845* Return:
846* TURE or FALSE
847*/
848int ql_uac_disable(void)
849{
850
851 return 0;
luojiana6a47a92024-05-23 13:42:21 +0800852}