4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Seungbae Shin <seungbae.shin@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
26 #include <semaphore.h>
28 #include "../../include/mm_sound_plugin_codec.h"
37 #include <pulse/sample.h>
38 #include "../../../include/mm_sound_pa_client.h"
41 #define M_PI 3.14159265358979323846
45 #define M_PI_2 1.57079632679489661923
48 #define SAMPLERATE 44100
50 #define SAMPLE_SIZE 16
52 #define MAX_DURATION 100
72 pthread_mutex_t syncker;
80 int size; /* sizeof hole amr data */
82 /* Audio Infomations */
85 /* control Informations */
107 typedef struct st_tone
110 float middle_frequency;
111 float high_frequency;
117 static const int TONE_SEGMENT[][MM_SOUND_TONE_NUM] =
119 {941, 1336, 0, -1, 0, 0,
120 -1, -1, -1, -1, 0, 0},// 0 key: 1336Hz, 941Hz
122 {697, 1209, 0, -1, 0, 0,
123 -1, -1, -1, -1, 0, 0},// 1 key: 1209Hz, 697Hz
125 {697, 1336, 0, -1, 0, 0,
126 -1, -1, -1, -1, 0, 0},// 2 key: 1336Hz, 697Hz
128 {697, 1477, 0, -1, 0, 0,
129 -1, -1, -1, -1, 0, 0}, // 3 key: 1477Hz, 697Hz
131 {770, 1209, 0, -1, 0, 0,
132 -1, -1, -1, -1, 0, 0},// 4 key: 1209Hz, 770Hz
134 {770, 1336, 0, -1, 0, 0,
135 -1, -1, -1, -1, 0, 0},// 5 key: 1336Hz, 770Hz
137 {770, 1477, 0, -1, 0, 0,
138 -1, -1, -1, -1, 0, 0},// 6 key: 1477Hz, 770Hz
140 {852, 1209, 0, -1, 0, 0,
141 -1, -1, -1, -1, 0, 0},// 7 key: 1209Hz, 852Hz
143 {852, 1336, 0, -1, 0, 0,
144 -1, -1, -1, -1, 0, 0},// 8 key: 1336Hz, 852Hz
146 {852, 1477, 0, -1, 0, 0,
147 -1, -1, -1, -1, 0, 0},// 9 key: 1477Hz, 852Hz
149 {941, 1209, 0, -1, 0, 0,
150 -1, -1, -1, -1, 0, 0},// * key: 1209Hz, 941Hz
152 {941, 1477, 0, -1, 0, 0,
153 -1, -1, -1, -1, 0, 0},// # key: 1477Hz, 941Hz
155 {697, 1633, 0, -1, 0, 0,
156 -1, -1, -1, -1, 0, 0},// A key: 1633Hz, 697Hz
158 {770, 1633, 0, -1, 0, 0,
159 -1, -1, -1, -1, 0, 0},// B key: 1633Hz, 770Hz
161 {852, 1633, 0, -1, 0, 0,
162 -1, -1, -1, -1, 0, 0},// C key: 1633Hz, 852Hz
164 {941, 1633, 0, -1, 0, 0,
165 -1, -1, -1, -1, 0, 0}, // D key: 1633Hz, 941Hz
167 {425, 0, 0, -1, 0, 0,
168 -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Dial tone: CEPT: 425Hz, continuous
170 {350, 440, 0, -1, 0, 0,
171 -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Dial tone: ANSI (IS-95): 350Hz+440Hz, continuous
173 {400, 0, 0, -1, 0, 0,
174 -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Dial tone: JAPAN: 400Hz, continuous
176 {425, 0, 0, 500, 0, 0,
178 -1, -1, -1, -1, 0, 0},//Call supervisory tone, Busy: CEPT: 425Hz, 500ms ON, 500ms OFF...
180 {480, 620, 0, 500, 0, 0,
182 -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Busy: ANSI (IS-95): 480Hz+620Hz, 500ms ON, 500ms OFF...
184 {400, 0, 0, 500, 0, 0,
186 -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Busy: JAPAN: 400Hz, 500ms ON, 500ms OFF...
188 {425, 0, 0, 200, 0, 0,
190 -1, -1, -1, -1, 1, 0}, //Call supervisory tone, Congestion: CEPT, JAPAN: 425Hz, 200ms ON, 200ms OFF
192 {480, 620, 0, 250, 0, 0,
194 -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Congestion: ANSI (IS-95): 480Hz+620Hz, 250ms ON, 250ms OFF...
196 {425, 0, 0, 200, 0, 0,
197 -1, -1, -1, -1, 1, 0}, //Call supervisory tone, Radio path acknowlegment : CEPT, ANSI: 425Hz, 200ms ON
199 {400, 0, 0, 1000, 0, 0,
201 -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Radio path acknowlegment : JAPAN: 400Hz, 1s ON, 2s OFF...
203 {425, 0, 0, 200, 0, 0,
205 -1, -1, -1, -1, 3, 0}, //Call supervisory tone, Radio path not available: 425Hz, 200ms ON, 200 OFF 3 bursts
207 {950, 1400, 1800, 330, 0, 0,
209 -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Error/Special info: 950Hz+1400Hz+1800Hz, 330ms ON, 1s OFF...
211 {425, 0, 0, 200, 0, 0,
213 425, 0, 0, 200, 0, 0,
215 -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Call Waiting: CEPT, JAPAN: 425Hz, 200ms ON, 600ms OFF, 200ms ON, 3s OFF...
217 {440, 0, 0, 300, 0, 0,
219 440, 0, 0, 100, 0, 0,
221 440, 0, 0, 100, 0, 0,
223 -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Call Waiting: ANSI (IS-95): 440 Hz, 300 ms ON, 9.7 s OFF, (100 ms ON, 100 ms OFF, 100 ms ON, 9.7s OFF ...)
225 {425, 0, 0, 1000, 0, 0,
227 -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Ring Tone: CEPT, JAPAN: 425Hz, 1s ON, 4s OFF...
229 {440, 480, 0, 2000, 0, 0,
231 -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Ring Tone: ANSI (IS-95): 440Hz + 480Hz, 2s ON, 4s OFF...
233 {400, 1200, 0, 35, 0, 0,
234 -1, -1, -1, -1, 1, 0}, // General beep: 400Hz+1200Hz, 35ms ON
236 {1200, 0, 0, 100, 0, 0,
238 -1, -1, -1, -1, 2, 0}, //Proprietary tone, positive acknowlegement: 1200Hz, 100ms ON, 100ms OFF 2 bursts
240 {300, 400, 500, 400, 0, 0,
241 -1, -1, -1, -1, 1, 0}, //Proprietary tone, negative acknowlegement: 300Hz+400Hz+500Hz, 400ms ON
243 {400, 1200, 0, 200, 0, 0,
244 -1, -1, -1, -1, 1, 0}, //Proprietary tone, prompt tone: 400Hz+1200Hz, 200ms ON
246 {400, 1200, 0, 35, 0, 0,
248 400, 1200, 0, 35, 0, 0,
249 -1, -1, -1, -1, 1, 0}, //Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON
251 {440, 0, 0, 250, 0, 0,
252 620, 0, 0, 250, 0, 0,
253 -1, -1, -1, -1, 1, 0}, //Call supervisory tone (IS-95), intercept tone: alternating 440 Hz and 620 Hz tones, each on for 250 ms
255 {440, 0, 0, 250, 0, 0,
256 620, 0, 0, 250, 0, 0,
257 -1, -1, -1, -1, 8, 0}, //Call supervisory tone (IS-95), abbreviated intercept: intercept tone limited to 4 seconds
259 {480, 620, 0, 250, 0, 0,
261 -1, -1, -1, -1, 8, 0 }, //Call supervisory tone (IS-95), abbreviated congestion: congestion tone limited to 4 seconds
263 {350, 440, 0, 100, 0, 0,
265 -1, -1, -1, -1, 3, 0}, //Call supervisory tone (IS-95), confirm tone: a 350 Hz tone added to a 440 Hz tone repeated 3 times in a 100 ms on, 100 ms off cycle
267 {480, 0, 0, 100, 0, 0,
269 -1, -1, -1, -1, 4, 0}, //Call supervisory tone (IS-95), pip tone: four bursts of 480 Hz tone (0.1 s on, 0.1 s off).
271 { 425, 0, 0, -1, 0, 0,
272 -1, -1, -1, -1, 0, 0}, //425Hz continuous
274 {440, 480, 0, 2000, 0, 0,
276 -1, -1, -1, -1, 0, 0}, //CDMA USA Ringback: 440Hz+480Hz 2s ON, 4000 OFF ...
278 {440, 0, 0, 250, 0, 0,
279 620, 0, 0, 250, 0, 0,
280 -1, -1, -1, -1, 0, 0}, //CDMA Intercept tone: 440Hz 250ms ON, 620Hz 250ms ON ...
282 {440, 0, 0, 250, 0, 0,
283 620, 0, 0, 250, 0, 0,
284 -1, -1, -1, -1, 1, 0 }, //CDMA Abbr Intercept tone: 440Hz 250ms ON, 620Hz 250ms ON
286 {480, 620, 0, 250, 0, 0,
288 -1, -1, -1, -1, 0, 0 }, //CDMA Reorder tone: 480Hz+620Hz 250ms ON, 250ms OFF...
290 {480, 620, 0, 250, 0, 0,
292 -1, -1, -1, -1, 8, 0}, //CDMA Abbr Reorder tone: 480Hz+620Hz 250ms ON, 250ms OFF repeated for 8 times
294 {480, 620, 0, 500, 0, 0,
296 -1, -1, -1, -1, 0, 0}, //CDMA Network Busy tone: 480Hz+620Hz 500ms ON, 500ms OFF continuous
298 {350, 440, 0, 100, 0, 0,
300 -1, -1, -1, -1, 3, 0}, //CDMA Confirm tone: 350Hz+440Hz 100ms ON, 100ms OFF repeated for 3 times
302 {660, 1000, 0, 500, 0, 0,
304 -1, -1, -1, -1, 1, 0}, //CDMA answer tone: silent tone - defintion Frequency 0, 0ms ON, 0ms OFF
306 {440, 0, 0, 300, 0, 0,
307 -1, -1, -1, -1, 1, 0}, //CDMA Network Callwaiting tone: 440Hz 300ms ON
309 {480, 0, 0, 100, 0, 0,
311 -1, -1, -1, -1, 4, 0}, //CDMA PIP tone: 480Hz 100ms ON, 100ms OFF repeated for 4 times
313 {2090, 0, 0, 32, 0, 0,
314 2556, 0, 0, 64, 19, 0,
315 2090, 0, 0, 32, 0, 0,
316 2556, 0, 0, 48, 0, 0,
318 -1, -1, -1, -1, 1, 0}, //ISDN Call Signal Normal tone: {2091Hz 32ms ON, 2556 64ms ON} 20 times, 2091 32ms ON, 2556 48ms ON, 4s OFF
320 {2091, 0, 0, 32, 0, 0,
321 2556, 0, 0, 64, 7, 0,
322 2091, 0, 0, 32, 0, 0,
324 2091, 0, 0, 32, 0, 0,
325 2556, 0, 0, 64, 7, 4,
326 2091, 0, 0, 32, 0, 0,
328 -1, -1, -1, -1, 1, 0}, //ISDN Call Signal Intergroup tone: {2091Hz 32ms ON, 2556 64ms ON} 8 times, 2091Hz 32ms ON, 400ms OFF, {2091Hz 32ms ON, 2556Hz 64ms ON} 8times, 2091Hz 32ms ON, 4s OFF
330 {2091, 0, 0, 32, 0, 0,
331 2556, 0, 0, 64, 3, 0,
332 2091, 0, 0, 32, 0, 0,
334 2091, 0, 0, 32, 0, 0,
335 2556, 0, 0, 64, 3, 4,
336 2091, 0, 0, 32, 0, 0,
338 -1, -1, -1, -1, 1, 0},//ISDN Call Signal SP PRI tone:{2091Hz 32ms ON, 2556 64ms ON} 4 times 2091Hz 16ms ON, 200ms OFF, {2091Hz 32ms ON, 2556Hz 64ms ON} 4 times, 2091Hz 16ms ON, 200ms OFF
341 -1, -1, -1, -1, 1, 0}, //ISDN Call sign PAT3 tone: silent tone
343 {2091, 0, 0, 32, 0, 0,
344 2556, 0, 0, 64, 4, 0,
345 2091, 0, 0, 20, 0, 0,
346 -1, -1, -1, -1, 1, 0}, //ISDN Ping Ring tone: {2091Hz 32ms ON, 2556Hz 64ms ON} 5 times 2091Hz 20ms ON
349 -1, -1, -1, -1, 1, 0}, //ISDN Pat5 tone: silent tone
352 -1, -1, -1, -1, 1, 0}, //ISDN Pat6 tone: silent tone
355 -1, -1, -1, -1, 1, 0}, //ISDN Pat7 tone: silent tone
357 {3700, 0, 0, 25, 0, 0,
358 4000, 0, 0, 25, 39, 0,
360 -1, -1, -1, -1, 0, 0}, //TONE_CDMA_HIGH_L tone: {3700Hz 25ms, 4000Hz 25ms} 40 times 4000ms OFF, Repeat ....
362 {2600, 0, 0, 25, 0, 0,
363 2900, 0, 0, 25, 39, 0,
365 -1, -1, -1, -1, 0, 0},//TONE_CDMA_MED_L tone: {2600Hz 25ms, 2900Hz 25ms} 40 times 4000ms OFF, Repeat ....
367 {1300, 0, 0, 25, 0, 0,
368 1450, 0, 0, 25, 39, 0,
370 -1, -1, -1, -1, 0, 0}, //TONE_CDMA_LOW_L tone: {1300Hz 25ms, 1450Hz 25ms} 40 times, 4000ms OFF, Repeat ....
372 {3700, 0, 0, 25, 0, 0,
373 4000, 0, 0, 25, 15, 0,
375 -1, -1, -1, -1, 0, 0},//CDMA HIGH SS tone: {3700Hz 25ms, 4000Hz 25ms} repeat 16 times, 400ms OFF, repeat ....
377 {2600, 0, 0, 25, 0, 0,
378 2900, 0, 0, 25, 15, 0,
380 -1, -1, -1, -1, 0, 0}, //CDMA MED SS tone: {2600Hz 25ms, 2900Hz 25ms} repeat 16 times, 400ms OFF, repeat ....
382 {1300, 0, 0, 25, 0, 0,
383 1450, 0, 0, 25, 15, 0,
385 -1, -1, -1, -1, 0, 0}, //CDMA LOW SS tone: {1300z 25ms, 1450Hz 25ms} repeat 16 times, 400ms OFF, repeat ....
387 {3700, 0, 0, 25, 0, 0,
388 4000, 0, 0, 25, 7, 0,
390 3700, 0, 0, 25, 0, 0,
391 4000, 0, 0, 25, 7, 3,
393 3700, 0, 0, 25, 0, 0,
394 4000, 0, 0, 25, 15, 6,
396 -1, -1, -1, -1, 0, 0}, //CDMA HIGH SSL tone: {3700Hz 25ms, 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} repeat 8 times, 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} repeat 16 times, 4000ms OFF, repeat ...
398 {2600, 0, 0, 25, 0, 0,
399 2900, 0, 0, 25, 7, 0,
401 2600, 0, 0, 25, 0, 0,
402 2900, 0, 0, 25, 7, 3,
404 2600, 0, 0, 25, 0, 0,
405 2900, 0, 0, 25, 15, 6,
407 -1, -1, -1, -1, 0, 0}, //CDMA MED SSL tone: {2600Hz 25ms, 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} repeat 8 times, 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} repeat 16 times, 4000ms OFF, repeat ...
409 {1300, 0, 0, 25, 0, 0,
410 1450, 0, 0, 25, 7, 0,
412 1300, 0, 0, 25, 0, 0,
413 1450, 0, 0, 25, 7, 3,
415 1300, 0, 0, 25, 0, 0,
416 1450, 0, 0, 25, 15, 6,
418 -1, -1, -1, -1, 0, 0}, //CDMA LOW SSL tone: {1300Hz 25ms, 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} repeat 8 times, 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} repeat 16 times, 4000ms OFF, repeat ...
420 {3700, 0, 0, 25, 0, 0,
421 4000, 0, 0, 25, 19, 0,
423 3700, 0, 0, 25, 0, 0,
424 4000, 0, 0, 25, 19, 3,
426 -1, -1, -1, -1, 0, 0 },//CDMA HIGH SS2 tone: {3700Hz 25ms, 4000Hz 25ms} 20 times, 1000ms OFF, {3700Hz 25ms, 4000Hz 25ms} 20 times, 3000ms OFF, repeat ....
428 {2600, 0, 0, 25, 0, 0,
429 2900, 0, 0, 25, 19, 0,
431 2600, 0, 0, 25, 0, 0,
432 2900, 0, 0, 25, 19, 3,
434 -1, -1, -1, -1, 0, 0}, //CDMA MED SS2 tone: {2600Hz 25ms, 2900Hz 25ms} 20 times, 1000ms OFF, {2600Hz 25ms, 2900Hz 25ms} 20 times, 3000ms OFF, repeat ....
436 {1300, 0, 0, 25, 0, 0,
437 1450, 0, 0, 25, 19, 0,
439 1300, 0, 0, 25, 0, 0,
440 1450, 0, 0, 25, 19, 3,
442 -1, -1, -1, -1, 0, 0 }, //CDMA LOW SS2 tone: {1300Hz 25ms, 1450Hz 25ms} 20 times, 1000ms OFF, {1300Hz 25ms, 1450Hz 25ms} 20 times, 3000ms OFF, repeat ....
444 {3700, 0, 0, 25, 0, 0,
445 4000, 0, 0, 25, 9, 0,
447 3700, 0, 0, 25, 0, 0,
448 4000, 0, 0, 25, 19, 3,
450 3700, 0, 0, 25, 0, 0,
451 4000, 0, 0, 25, 9, 6,
453 -1, -1, -1, -1, 0, 0}, //CDMA HIGH SLS tone: {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 20 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 3000ms OFF, REPEAT....
455 {2600, 0, 0, 25, 0, 0,
456 2900, 0, 0, 25, 9, 0,
458 2600, 0, 0, 25, 0, 0,
459 2900, 0, 0, 25, 19, 3,
461 2600, 0, 0, 25, 0, 0,
462 2900, 0, 0, 25, 9, 6,
464 -1, -1, -1, -1, 0, 0}, //CDMA MED SLS tone: {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 20 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 3000ms OFF, REPEAT....
466 {1300, 0, 0, 25, 0, 0,
467 1450, 0, 0, 25, 9, 0,
469 1300, 0, 0, 25, 0, 0,
470 1450, 0, 0, 25, 19, 3,
472 1300, 0, 0, 25, 0, 0,
473 1450, 0, 0, 25, 9, 6,
475 -1, -1, -1, -1, 0, 0}, //CDMA LOW SLS tone: {1300Hz 25ms, 1450Hz 25ms} 10 times, 500ms OFF, {1300Hz 25ms, 1450Hz 25ms} 20 times, 500ms OFF, {1300Hz 25ms, 1450Hz 25ms} 10 times, 3000ms OFF, REPEAT....
477 {3700, 0, 0, 25, 0, 0,
478 4000, 0, 0, 25, 9, 0,
480 3700, 0, 0, 25, 0, 0,
481 4000, 0, 0, 25, 9, 3,
483 3700, 0, 0, 25, 0, 0,
484 4000, 0, 0, 25, 9, 6,
486 -1, -1, -1, -1, 0, 0}, ////CDMA HIGH S X4 tone: {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 2500ms OFF, REPEAT....
488 {2600, 0, 0, 25, 0, 0,
489 2900, 0, 0, 25, 9, 0,
491 2600, 0, 0, 25, 0, 0,
492 2900, 0, 0, 25, 9, 4,
494 2600, 0, 0, 25, 0, 0,
495 2900, 0, 0, 25, 9, 6,
497 -1, -1, -1, -1, 0, 0 },//CDMA MED S X4 tone: {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 2500ms OFF, REPEAT....
499 {1300, 0, 0, 25, 0, 0,
500 1450, 0, 0, 25, 9, 0,
502 1300, 0, 0, 25, 0, 0,
503 1450, 0, 0, 25, 9, 3,
505 1300, 0, 0, 25, 0, 0,
506 1450, 0, 0, 25, 9, 6,
508 -1, -1, -1, -1, 0, 0}, //CDMA LOW S X4 tone: {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 2500ms OFF, REPEAT....
510 {3700, 0, 0, 25, 0, 0,
511 4000, 0, 0, 25, 19, 0,
513 -1, -1, -1, -1, 0, 0 },//CDMA HIGH PBX L: {3700Hz 25ms, 4000Hz 25ms}20 times, 2000ms OFF, REPEAT....
515 {2600, 0, 0, 25, 0, 0,
516 2900, 0, 0, 25, 19, 0,
518 -1, -1, -1, -1, 0, 0}, //CDMA MED PBX L: {2600Hz 25ms, 2900Hz 25ms}20 times, 2000ms OFF, REPEAT....
520 {1300, 0, 0, 25, 0, 0,
521 1450, 0, 0, 25, 19, 0,
523 -1, -1, -1, -1, 0, 0 },//CDMA LOW PBX L: {1300Hz 25ms,1450Hz 25ms}20 times, 2000ms OFF, REPEAT....
525 {3700, 0, 0, 25, 0, 0,
526 4000, 0, 0, 25, 7, 0,
528 3700, 0, 0, 25, 0, 0,
529 4000, 0, 0, 25, 7, 3,
531 -1, -1, -1, -1, 0, 0}, //CDMA HIGH PBX SS tone: {3700Hz 25ms, 4000Hz 25ms} 8 times 200 ms OFF, {3700Hz 25ms 4000Hz 25ms}8 times, 2000ms OFF, REPEAT....
533 {2600, 0, 0, 25, 0, 0,
534 2900, 0, 0, 25, 7, 0,
536 2600, 0, 0, 25, 0, 0,
537 2900, 0, 0, 25, 7, 3,
539 -1, -1, -1, -1, 0, 0 }, //CDMA MED PBX SS tone: {2600Hz 25ms, 2900Hz 25ms} 8 times 200 ms OFF, {2600Hz 25ms 2900Hz 25ms}8 times, 2000ms OFF, REPEAT....
541 {1300, 0, 0, 25, 0, 0,
542 1450, 0, 0, 25, 7, 0,
544 1300, 0, 0, 25, 0, 0,
545 1450, 0, 0, 25, 7, 3,
547 -1, -1, -1, -1, 0, 0 },//CDMA LOW PBX SS tone: {1300Hz 25ms, 1450Hz 25ms} 8 times 200 ms OFF, {1300Hz 25ms 1450Hz 25ms}8 times, 2000ms OFF, REPEAT....
549 {3700, 0, 0, 25, 0, 0,
550 4000, 0, 0, 25, 7, 0,
552 3700, 0, 0, 25, 0, 0,
553 4000, 0, 0, 25, 7, 3,
555 3700, 0, 0, 25, 0, 0,
556 4000, 0, 0, 25, 15, 6,
558 -1, -1, -1, -1, 0, 0}, //CDMA HIGH PBX SSL tone:{3700Hz 25ms, 4000Hz 25ms} 8 times 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 16 times, 1000ms OFF, REPEAT....//
560 {2600, 0, 0, 25, 0, 0,
561 2900, 0, 0, 25, 7, 0,
563 2600, 0, 0, 25, 0, 0,
564 2900, 0, 0, 25, 7, 3,
566 2600, 0, 0, 25, 0, 0,
567 2900, 0, 0, 25, 15, 6,
569 -1, -1, -1, -1, 0, 0}, //CDMA MED PBX SSL tone:{2600Hz 25ms, 2900Hz 25ms} 8 times 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 16 times, 1000ms OFF, REPEAT....//
571 {1300, 0, 0, 25, 0, 0,
572 1450, 0, 0, 25, 7, 0,
574 1300, 0, 0, 25, 0, 0,
575 1450, 0, 0, 25, 7, 3,
577 1300, 0, 0, 25, 0, 0,
578 1450, 0, 0, 25, 15, 6,
580 -1, -1, -1, -1, 0, 0}, //CDMA LOW PBX SSL tone:{1300Hz 25ms, 1450Hz 25ms} 8 times 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 16 times, 1000ms OFF, REPEAT....//
582 {3700, 0, 0, 25, 0, 0,
583 4000, 0, 0, 25, 15, 0,
585 3700, 0, 0, 25, 0, 0,
586 4000, 0, 0, 25, 7, 3,
588 -1, -1, -1, -1, 0, 0 },//CDMA HIGH PBX SLS tone:{3700Hz 25ms, 4000Hz 25ms} 8 times 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 16 times, 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 8 times, 1000ms OFF, REPEAT.... //
590 {2600, 0, 0, 25, 0, 0,
591 2900, 0, 0, 25, 15, 0,
593 2600, 0, 0, 25, 0, 0,
594 2900, 0, 0, 25, 7, 3,
596 -1, -1, -1, -1, 0, 0 }, //CDMA HIGH PBX SLS tone:{2600Hz 25ms, 2900Hz 25ms} 8 times 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 16 times, 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 8 times, 1000ms OFF, REPEAT....//
598 {1300, 0, 0, 25, 0, 0,
599 1450, 0, 0, 25, 15, 0,
601 1300, 0, 0, 25, 0, 0,
602 1450, 0, 0, 25, 7, 3,
604 -1, -1, -1, -1, 0, 0 }, //CDMA HIGH PBX SLS tone:{1300Hz 25ms, 1450Hz 25ms} 8 times 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 16 times, 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 8 times, 1000ms OFF, REPEAT....//
606 {3700, 0, 0, 25, 0, 0,
607 4000, 0, 0, 25, 7, 0,
609 3700, 0, 0, 25, 0, 0,
610 4000, 0, 0, 25, 7, 3,
612 3700, 0, 0, 25, 0, 0,
613 4000, 0, 0, 25, 7, 6,
615 3700, 0, 0, 25, 0, 0,
616 4000, 0, 0, 25, 7, 9,
618 -1, -1, -1, -1, 0, 0}, //CDMA HIGH PBX X S4 tone: {3700Hz 25ms 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms 4000Hz 25ms} 8 times, 800ms OFF, REPEAT...
620 {2600, 0, 0, 25, 0, 0,
621 2900, 0, 0, 25, 7, 0,
623 2600, 0, 0, 25, 0, 0,
624 2900, 0, 0, 25, 7, 3,
626 2600, 0, 0, 25, 0, 0,
627 2900, 0, 0, 25, 7, 6,
629 2600, 0, 0, 25, 0, 0,
630 2900, 0, 0, 25, 7, 9,
632 -1, -1, -1, -1, 0, 0}, //CDMA MED PBX X S4 tone: {2600Hz 25ms 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms 2900Hz 25ms} 8 times, 800ms OFF, REPEAT...
634 {1300, 0, 0, 25, 0, 0,
635 1450, 0, 0, 25, 7, 0,
637 1300, 0, 0, 25, 0, 0,
638 1450, 0, 0, 25, 7, 3,
640 1300, 0, 0, 25, 0, 0,
641 1450, 0, 0, 25, 7, 6,
643 1300, 0, 0, 25, 0, 0,
644 1450, 0, 0, 25, 7, 9,
646 -1, -1, -1, -1, 0, 0}, //CDMA LOW PBX X S4 tone: {1300Hz 25ms 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms 1450Hz 25ms} 8 times, 800ms OFF, REPEAT...
648 {1109, 0, 0, 62, 0, 0,
652 1109, 0, 0, 62, 0, 0,
653 -1, -1, -1, -1, 1, 0}, //CDMA Alert Network Lite tone: 1109Hz 62ms ON, 784Hz 62ms ON, 740Hz 62ms ON 622Hz 62ms ON, 1109Hz 62ms ON
655 {1245, 0, 0, 62, 0, 0,
657 1245, 0, 0, 62, 0, 0,
659 1245, 0, 0, 62, 0, 0,
661 1245, 0, 0, 62, 0, 0,
662 -1, -1, -1, -1, 1, 0},//CDMA Alert Auto Redial tone: {1245Hz 62ms ON, 659Hz 62ms ON} 3 times, 1245 62ms ON//
664 {1150, 770, 0, 400, 0, 0,
665 -1, -1, -1, -1, 1, 0}, //CDMA One Min Beep tone: 1150Hz+770Hz 400ms ON//
667 {941, 1477, 0, 120, 0, 0,
668 -1, -1, -1, -1, 1, 0}, //CDMA KEYPAD Volume key lite tone: 941Hz+1477Hz 120ms ON
670 {587, 0, 0, 375, 0, 0,
671 1175, 0, 0, 125, 0, 0,
672 -1, -1, -1, -1, 1, 0}, //CDMA PRESSHOLDKEY LITE tone: 587Hz 375ms ON, 1175Hz 125ms ON
674 {587, 0, 0, 62, 0, 0,
678 1109, 0, 0, 62, 0, 0,
682 -1, -1, -1, -1, 1, 0}, //CDMA ALERT INCALL LITE tone: 587Hz 62ms, 784 62ms, 831Hz 62ms, 784Hz 62ms, 1109 62ms, 784Hz 62ms, 831Hz 62ms, 784Hz 62ms
684 {941, 0, 0, 125, 0, 0,
686 941, 0, 0, 125, 0, 0,
688 1245, 0, 0, 62, 0, 0,
691 -1, -1, -1, -1, 0, 0}, //CDMA EMERGENCY RINGBACK tone: {941Hz 125ms ON, 10ms OFF} 3times 4990ms OFF, REPEAT...
693 {1319, 0, 0, 125, 0, 0,
695 -1, -1, -1, -1, 3, 0 }, //CDMA ALERT CALL GUARD tone: {1319Hz 125ms ON, 125ms OFF} 3 times
697 {1047, 0, 0, 125, 0, 0,
698 370, 0, 0, 125, 0, 0,
699 -1, -1, -1, -1, 1, 0}, //CDMA SOFT ERROR LITE tone: 1047Hz 125ms ON, 370Hz 125ms
701 {1480, 0, 0, 125, 0, 0,
702 1397, 0, 0, 125, 0, 0,
703 784, 0, 0, 125, 0, 0,
704 -1, -1, -1, -1, 1, 0}, //CDMA CALLDROP LITE tone: 1480Hz 125ms, 1397Hz 125ms, 784Hz 125ms//
706 {425, 0, 0, 125, 0, 0,
708 -1, -1, -1, -1, 1, 0},//CDMA_NETWORK_BUSY_ONE_SHOT tone: 425Hz 500ms ON, 500ms OFF
710 {1150, 770, 0, 400, 0, 0,
711 -1, -1, -1, -1, 1, 0}, //CDMA_ABBR_ALERT tone: 1150Hz+770Hz 400ms ON
714 -1, -1, -1, -1, 1, 0}, //CDMA_SIGNAL_OFF - silent tone
716 {100, 0, 0, -1, 0, 0,
717 -1, -1, -1, -1, 0, 0}, //100Hz continuous
719 {200, 0, 0, -1, 0, 0,
720 -1, -1, -1, -1, 0, 0}, //200Hz continuous
722 {300, 0, 0, -1, 0, 0,
723 -1, -1, -1, -1, 0, 0}, //300Hz continuous
727 static tone_control_t g_control;
730 static int (*g_thread_pool_func)(void*, void (*)(void*)) = NULL;
732 static int _MMSoundToneInit(void);
733 static int _MMSoundToneFini(void);
735 static void _running_tone(void *param);
739 int* MMSoundPlugCodecToneGetSupportTypes(void)
742 static int suported[2] = {MM_SOUND_SUPPORTED_CODEC_DTMF, 0};
747 int MMSoundPlugCodecToneParse(MMSourceType *source, mmsound_codec_info_t *info)
752 return MM_ERROR_NONE;
755 int MMSoundPlugCodecToneCreate(mmsound_codec_param_t *param, mmsound_codec_info_t *info, MMHandleType *handle)
757 tone_info_t *toneInfo;
759 mm_sound_handle_route_info route_info;
763 int result = MM_ERROR_NONE;
767 toneInfo = (tone_info_t *)malloc(sizeof(tone_info_t));
768 if (toneInfo == NULL) {
769 debug_error("memory allocation error\n");
770 return MM_ERROR_OUT_OF_MEMORY;
773 memset(toneInfo, 0, sizeof(tone_info_t));
775 toneInfo->state = STATE_READY;
777 ss.rate = SAMPLERATE;
778 ss.channels = CHANNELS;
779 ss.format = PA_SAMPLE_S16LE;
780 route_info.policy = HANDLE_ROUTE_POLICY_OUT_AUTO;
782 toneInfo->handle = mm_sound_pa_open(HANDLE_MODE_OUTPUT, &route_info, HANDLE_PRIORITY_NORMAL, param->volume_config, &ss, NULL, &size, param->stream_type, param->stream_index);
783 if (!toneInfo->handle) {
784 debug_error("Device Open Error 0x%x\n", result);
787 debug_log("Create audio_handle is %lu\n", toneInfo->handle);
789 debug_msg("tone : %d\n", param->tone);
790 debug_msg("repeat : %d\n", param->repeat_count);
791 debug_msg("volume config : %x\n", param->volume_config);
792 debug_msg("callback : %p\n", param->stop_cb);
793 debug_msg("pid : %d\n", param->pid);
795 toneInfo->number = param->tone;
796 toneInfo->time = param->repeat_count;
797 toneInfo->stop_cb = param->stop_cb;
798 toneInfo->cb_param = param->param;
799 toneInfo->pid = param->pid;
800 toneInfo->volume = param->volume;
802 result = g_thread_pool_func(toneInfo, _running_tone);
804 debug_error("pthread_create() fail in pcm thread\n");
805 result = MM_ERROR_SOUND_INTERNAL;
809 *handle = (MMHandleType)toneInfo;
812 return MM_ERROR_NONE;
816 if(toneInfo->handle) {
817 if(MM_ERROR_NONE != mm_sound_pa_close(toneInfo->handle))
818 debug_error("mm_sound_pa_close() fail. handle(%lu)\n", toneInfo->handle);
827 int MMSoundPlugCodecToneDestroy(MMHandleType handle)
829 tone_info_t *toneInfo = (tone_info_t*) handle;
830 int err = MM_ERROR_NONE;
832 debug_critical("Confirm the hadle (is NULL)\n");
833 return MM_ERROR_SOUND_INTERNAL;
836 debug_enter("(handle %x)\n", handle);
846 int MMSoundPlugCodecTonePlay(MMHandleType handle)
848 tone_info_t *toneInfo = (tone_info_t *) handle;
850 debug_enter("(handle %x)\n", handle);
852 toneInfo->state = STATE_BEGIN;
853 debug_msg("sent start signal\n");
857 return MM_ERROR_NONE;
861 _create_tone(double *sample, TONE _TONE, double volume, int *toneSize, gboolean is_cycle_ended)
865 double amplitude, f1, f2, f3;
868 float middle_frequency;
869 float high_frequency;
875 middle_frequency = 0;
878 low_frequency = _TONE.low_frequency;
879 middle_frequency = _TONE.middle_frequency;
880 high_frequency = _TONE.high_frequency;
884 debug_error("Sample buffer is not allocated\n");
888 /* Create a buffer for the tone */
889 if((_TONE.playingTime > MAX_DURATION) || (_TONE.playingTime == -1) ) {
890 *toneSize = ((MAX_DURATION / 1000.) * SAMPLERATE * SAMPLE_SIZE * CHANNELS) / 8;
892 *toneSize = ((_TONE.playingTime / 1000.) * SAMPLERATE * SAMPLE_SIZE * CHANNELS) / 8;
894 *toneSize = ((*toneSize+1)>>1)<<1;
895 sample_size = (*toneSize) / (SAMPLE_SIZE / 8);
897 debug_log("%0.f, %0.f, %0.f _TONE.playing_time: %d toneSize: %d\n",
898 low_frequency, middle_frequency, high_frequency, _TONE.playingTime, *toneSize);
900 buffer = g_malloc (*toneSize);
902 debug_error("Buffer is not allocated\n");
905 pbuf = (short*)buffer;
907 if(_TONE.low_frequency > 0) {
910 if(_TONE.middle_frequency > 0) {
913 if(_TONE.high_frequency > 0) {
917 for (i = 0; i < sample_size; i++) {
919 * We add the fundamental frequencies together.
922 f1 = sin (2 * M_PI * low_frequency * ((*sample) / SAMPLERATE));
923 f2 = sin (2 * M_PI * middle_frequency * ((*sample) / SAMPLERATE));
924 f3 = sin (2 * M_PI * high_frequency * ((*sample) / SAMPLERATE));
926 if(f1 + f2 + f3 != 0) {
927 amplitude = (f1 + f2 + f3) / quota;
928 /* Adjust the volume */
931 /* Make the [-1:1] interval into a [-32767:32767] interval */
937 /* Store it in the data buffer */
938 *(pbuf++) = (short) amplitude;
947 _mm_get_tone(int key, int CurIndex)
951 _TONE.low_frequency = TONE_SEGMENT[key][CurIndex * TONE_COLUMN + LOW_FREQUENCY];
952 _TONE.middle_frequency = TONE_SEGMENT[key][CurIndex * TONE_COLUMN + MIDDLE_FREQUENCY];
953 _TONE.high_frequency = TONE_SEGMENT[key][CurIndex * TONE_COLUMN + HIGH_FREQUENCY];
954 _TONE.playingTime = TONE_SEGMENT[key][CurIndex * TONE_COLUMN + PLAYING_TIME];
955 _TONE.loopCnt = TONE_SEGMENT[key][CurIndex * TONE_COLUMN + LOOP_COUNT];
956 _TONE.loopIndx = TONE_SEGMENT[key][CurIndex * TONE_COLUMN + LOOP_INDEX];
962 _mm_get_waveCnt_PlayingTime(int toneTime, TONE _TONE, int *waveCnt, int *waveRestPlayTime)
964 int ret = MM_ERROR_NONE;
965 if(waveCnt == NULL || waveRestPlayTime == NULL) {
966 debug_error("waveCnt || waveRestPlayTime buffer is NULL\n");
967 return MM_ERROR_SOUND_INTERNAL;
969 /*Set wave count and wave playing time*/
970 if( _TONE.playingTime == -1) {
971 *waveCnt = abs(toneTime) /MAX_DURATION;
972 *waveRestPlayTime = abs(toneTime) % MAX_DURATION;
974 *waveCnt = _TONE.playingTime /MAX_DURATION;
975 *waveRestPlayTime = _TONE.playingTime % MAX_DURATION;
981 _mm_get_CurIndex(TONE _TONE, int *CurArrayPlayCnt, int *CurIndex)
983 int ret = MM_ERROR_NONE;
984 if(CurArrayPlayCnt == NULL || CurIndex == NULL) {
985 debug_error("CurArrayPlayCnt || CurIndex buffer is NULL\n");
986 return MM_ERROR_SOUND_INTERNAL;
989 if(_TONE.loopCnt != 0 && *CurArrayPlayCnt <= _TONE.loopCnt) {
990 (*CurArrayPlayCnt)++;
991 if(*CurArrayPlayCnt >_TONE.loopCnt) {
993 *CurArrayPlayCnt = 0;
995 *CurIndex = _TONE.loopIndx;
1000 debug_log("[%d] CurIndex: %d", *CurArrayPlayCnt, *CurIndex);
1004 static void _running_tone(void *param)
1006 char *ptoneBuf = NULL;
1010 debug_error("param Buffer is not allocated\n");
1013 tone_info_t *toneInfo = (tone_info_t*) param;
1016 int prePlayingTime = 0;
1018 int playingTime = 0;
1020 int CurWaveIndex = 0;
1022 int waveRestPlayTime = 0;
1024 int CurArrayPlayCnt = 0;
1025 gboolean is_cycle_ended = FALSE;
1029 toneTime = toneInfo->time;
1031 toneKey = toneInfo->number;
1032 debug_msg ("toneKey number = %d\n", toneKey);
1034 /* Set pid check file */
1035 snprintf(filename, sizeof(filename), "/proc/%d/cmdline", toneInfo->pid);
1037 debug_msg("Wait start signal\n");
1038 while(toneInfo->state == STATE_READY)
1040 debug_msg("Recv start signal\n");
1041 toneInfo->state = STATE_PLAY;
1047 TONE _TONE = _mm_get_tone(toneKey, CurIndex); /*Pop one of Tone Set */
1048 if(_mm_get_waveCnt_PlayingTime(toneTime, _TONE, &numWave, &waveRestPlayTime) != MM_ERROR_NONE) {
1049 debug_error("_mm_get_waveCnt_PlayingTime return value error\n");
1053 if(_mm_get_CurIndex(_TONE, &CurArrayPlayCnt, &CurIndex) != MM_ERROR_NONE) {
1054 debug_error("_mm_get_CurIndex return value error\n");
1058 debug_log ("Predefined Tone[%d] Total Play time (ms) : %d, _TONE.playing_time: %d _numWave = %d low_frequency: %0.f, middle_frequency: %0.f, high_frequency: %0.f\n",
1059 CurIndex, toneTime, _TONE.playingTime, numWave, _TONE.low_frequency, _TONE.middle_frequency, _TONE.high_frequency);
1062 if (_TONE.low_frequency == -1) { /* skip frequency which's value is -1*/
1063 if((_TONE.loopCnt > 0) && (CurArrayPlayCnt == _TONE.loopCnt)) {
1064 is_cycle_ended = TRUE;
1065 debug_log("[is_cycle_ended]");
1067 CurIndex = _TONE.loopIndx;
1071 /* Write pcm data */
1072 for(CurWaveIndex = 0; CurWaveIndex < numWave+1; CurWaveIndex++) {
1073 if(CurWaveIndex == numWave ) { /* play the last tone set*/
1074 playingTime = waveRestPlayTime;
1076 playingTime = MAX_DURATION;
1078 duration = playingTime;
1080 if(playingTime == 0) {
1084 if(prePlayingTime + playingTime > toneTime && toneTime != -1) {
1085 playingTime = toneTime - prePlayingTime;
1088 ptoneBuf = _create_tone(&sample, _TONE, toneInfo->volume, &toneSize, is_cycle_ended);
1089 if(ptoneBuf == NULL) {
1090 debug_error("Tone Buffer is not allocated\n");
1093 debug_log ("[TONE] Play.....%dth %dms\n", CurWaveIndex, playingTime);
1094 mm_sound_pa_write(toneInfo->handle, ptoneBuf, ((toneSize * playingTime /duration + 1)>>1)<<1);
1095 prePlayingTime += playingTime;
1096 debug_log ("previous_sum: %d\n", prePlayingTime);
1100 if(prePlayingTime == toneTime || toneInfo->state != STATE_PLAY) {
1101 debug_log ("Finished.....on Total Playing Time : %d _TONE.playing_time: %d\n", prePlayingTime, _TONE.playingTime);
1102 mm_sound_pa_drain(toneInfo->handle);
1103 debug_log ("Finished.....quit loop\n");
1106 debug_log ("[%d] CurIndex: %d previous_sum: %d\n", CurArrayPlayCnt, CurIndex, prePlayingTime);
1111 if(MM_ERROR_NONE != mm_sound_pa_close(toneInfo->handle))
1112 debug_error("mm_sound_pa_close() fail. handle(%lu)\n", toneInfo->handle);
1115 pthread_mutex_destroy(&g_control.syncker);
1118 debug_msg("Play end\n");
1119 toneInfo->state = STATE_NONE;
1121 if (toneInfo->stop_cb)
1122 toneInfo->stop_cb(toneInfo->cb_param);
1128 int MMSoundPlugCodecToneStop(MMHandleType handle)
1130 tone_info_t *toneInfo = (tone_info_t*) handle;
1132 debug_enter("(handle %x)\n", handle);
1133 toneInfo->state = STATE_STOP;
1134 debug_msg("sent stop signal\n");
1136 while(toneInfo->state != STATE_NONE) {
1142 return MM_ERROR_NONE;
1146 int MMSoundPlugCodecToneSetThreadPool(int (*func)(void*, void (*)(void*)))
1148 debug_enter("(func : 0x%x)\n", func);
1149 g_thread_pool_func = func;
1151 return MM_ERROR_NONE;
1155 static int _MMSoundToneInit(void)
1157 memset(&g_control, 0, sizeof(tone_control_t));
1158 pthread_mutex_init(&g_control.syncker, NULL);
1159 return MM_ERROR_NONE;
1162 static int _MMSoundToneFini(void)
1164 pthread_mutex_destroy(&g_control.syncker);
1165 return MM_ERROR_NONE;
1170 int MMSoundGetPluginType(void)
1174 return MM_SOUND_PLUGIN_TYPE_CODEC;
1178 int MMSoundPlugCodecGetInterface(mmsound_codec_interface_t *intf)
1182 intf->GetSupportTypes = MMSoundPlugCodecToneGetSupportTypes;
1183 intf->Parse = MMSoundPlugCodecToneParse;
1184 intf->Create = MMSoundPlugCodecToneCreate;
1185 intf->Destroy = MMSoundPlugCodecToneDestroy;
1186 intf->Play = MMSoundPlugCodecTonePlay;
1187 intf->Stop = MMSoundPlugCodecToneStop;
1188 intf->SetThreadPool = MMSoundPlugCodecToneSetThreadPool;
1192 return MM_ERROR_NONE;