189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project/*
289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project * Copyright (C) 2008 The Android Open Source Project
389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project *
489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project * Licensed under the Apache License, Version 2.0 (the "License");
589fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project * you may not use this file except in compliance with the License.
689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project * You may obtain a copy of the License at
789fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project *
889fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project *      http://www.apache.org/licenses/LICENSE-2.0
989fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project *
1089fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project * Unless required by applicable law or agreed to in writing, software
1189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project * distributed under the License is distributed on an "AS IS" BASIS,
1289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project * See the License for the specific language governing permissions and
1489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project * limitations under the License.
1589fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project */
1689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
1789fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//#define LOG_NDEBUG 0
1889fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project#define LOG_TAG "ToneGenerator"
1989fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
2089fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project#include <math.h>
2189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project#include <utils/Log.h>
220b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent#include <cutils/properties.h>
2389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project#include "media/ToneGenerator.h"
2489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
250b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent
2689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Projectnamespace android {
2789fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
280b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent
2989fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project// Descriptors for all available tones (See ToneGenerator::ToneDescriptor class declaration for details)
300b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurentconst ToneGenerator::ToneDescriptor ToneGenerator::sToneDescriptors[] = {
315e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: {{ duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1336, 941, 0 }, 0, 0},
325e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                     { duration: 0 , waveFreq: { 0 }, 0, 0}},
330b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
340b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_DTMF_0
355e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1209, 697, 0 }, 0, 0 },
365e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
370b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
380b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_DTMF_1
395e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1336, 697, 0 }, 0, 0 },
405e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
410b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
420b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_DTMF_2
435e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1477, 697, 0 }, 0, 0 },
445e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
450b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
460b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_DTMF_3
475e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1209, 770, 0 }, 0, 0 },
485e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
490b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
500b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_DTMF_4
515e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1336, 770, 0 }, 0, 0 },
525e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
530b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
540b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_DTMF_5
555e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1477, 770, 0 }, 0, 0 },
565e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
570b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
580b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_DTMF_6
595e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1209, 852, 0 }, 0, 0 },
605e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
610b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
620b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_DTMF_7
635e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1336, 852, 0 }, 0, 0 },
645e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
650b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
660b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_DTMF_8
675e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1477, 852, 0 }, 0, 0 },
685e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
690b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
700b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_DTMF_9
715e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1209, 941, 0 }, 0, 0 },
725e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
730b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
740b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_DTMF_S
755e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1477, 941, 0 }, 0, 0 },
765e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
770b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
780b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_DTMF_P
795e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1633, 697, 0 }, 0, 0 },
805e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
810b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
820b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_DTMF_A
835e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1633, 770, 0 }, 0, 0 },
845e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
850b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
860b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                             // TONE_DTMF_B
875e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1633, 852, 0 }, 0, 0 },
885e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
890b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
900b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_DTMF_C
915e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1633, 941, 0 }, 0, 0 },
925e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
930b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
940b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_DTMF_D
955e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 425, 0 }, 0, 0 },
965e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
970b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
980b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_SUP_DIAL
995e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 500 , waveFreq: { 425, 0 }, 0, 0},
1005e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 500, waveFreq: { 0 }, 0, 0},
1015e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                         { duration: 0 , waveFreq: { 0 }, 0, 0}},
1020b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
1030b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_SUP_BUSY
1045e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 200, waveFreq: { 425, 0 }, 0, 0 },
1055e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
1065e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
1070b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
1080b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_SUP_CONGESTION
1095e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 200, waveFreq: { 425, 0 }, 0, 0 },
1105e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
1110b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: 0,
1120b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_SUP_RADIO_ACK
1135e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 200, waveFreq: { 425, 0 }, 0, 0},
1145e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0},
1155e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
1160b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: 2,
1170b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_SUP_RADIO_NOTAVAIL
1185e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 330, waveFreq: { 950, 1400, 1800, 0 }, 0, 0},
1195e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 1000, waveFreq: { 0 }, 0, 0},
1205e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
1210b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
1220b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_SUP_ERROR
1235e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 200, waveFreq: { 425, 0 }, 0, 0 },
1245e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 600, waveFreq: { 0 }, 0, 0 },
1255e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 425, 0 }, 0, 0 },
1265e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 3000, waveFreq: { 0 }, 0, 0 },
1275e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
1280b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
1290b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_SUP_CALL_WAITING
1305e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 1000, waveFreq: { 425, 0 }, 0, 0 },
1315e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 4000, waveFreq: { 0 }, 0, 0 },
1325e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
1330b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
1340b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_SUP_RINGTONE
1355e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 40, waveFreq: { 400, 1200, 0 }, 0, 0 },
1365e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
1370b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: 0,
1380b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_PROP_BEEP
1395e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 100, waveFreq: { 1200, 0 }, 0, 0 },
1405e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 100, waveFreq: { 0 }, 0, 0  },
1415e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
1420b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: 1,
1430b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_PROP_ACK
1445e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 400, waveFreq: { 300, 400, 500, 0 }, 0, 0 },
1455e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
1460b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: 0,
1470b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_PROP_NACK
1485e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 200, waveFreq: { 400, 1200, 0 }, 0, 0 },
1495e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
1500b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: 0,
1510b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_PROP_PROMPT
1525e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 40, waveFreq: { 400, 1200, 0 }, 0, 0 },
1535e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
1545e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 40, waveFreq: { 400, 1200, 0 }, 0, 0 },
1555e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
1560b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: 0,
1570b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                             // TONE_PROP_BEEP2
1585e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 250, waveFreq: { 440, 0 }, 0, 0 },
1595e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 250, waveFreq: { 620, 0 }, 0, 0 },
1605e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0 }},
1610b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
1620b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_SUP_INTERCEPT
1635e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 250, waveFreq: { 440, 0 }, 0, 0 },
1645e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 250, waveFreq: { 620, 0 }, 0, 0 },
1655e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
1660b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: 7,
1670b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                             // TONE_SUP_INTERCEPT_ABBREV
1685e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 250, waveFreq: { 480, 620, 0 }, 0, 0 },
1695e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 250, waveFreq: { 0 }, 0, 0 },
1705e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
1710b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: 7,
1720b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                             // TONE_SUP_CONGESTION_ABBREV
1735e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 100, waveFreq: { 350, 440, 0 }, 0, 0 },
1745e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 100, waveFreq: { 0 }, 0, 0 },
1755e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
1760b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: 2,
1770b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                             // TONE_SUP_CONFIRM
1785e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 100, waveFreq: { 480, 0 }, 0, 0 },
1795e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 100, waveFreq: { 0 }, 0, 0 },
1805e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
1810b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: 3,
1820b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_SUP_PIP
1835e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: {{ duration: ToneGenerator::TONEGEN_INF, waveFreq: { 425, 0 }, 0, 0},
1845e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                     { duration: 0 , waveFreq: { 0 }, 0, 0}},
1855e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
1865e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                              // TONE_CDMA_DIAL_TONE_LITE
1875e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 2000, waveFreq: { 440, 480, 0 }, 0, 0 },
1885e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 4000, waveFreq: { 0 }, 0, 0 },
1895e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
1905e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
1915e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                              // TONE_CDMA_NETWORK_USA_RINGBACK
1925e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 250, waveFreq: { 440, 0 }, 0, 0 },
1935e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 250, waveFreq: { 620, 0 }, 0, 0 },
1945e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
1955e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt:  ToneGenerator::TONEGEN_INF,
1965e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                             // TONE_CDMA_INTERCEPT
1975e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 250, waveFreq: { 440, 0 }, 0, 0 },
1985e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 250, waveFreq: { 620, 0 }, 0, 0 },
1995e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
2005e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt:  0,
2015e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                             // TONE_CDMA_ABBR_INTERCEPT
2025e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 250, waveFreq: { 480, 620, 0 }, 0, 0 },
2035e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 250, waveFreq: { 0 }, 0, 0 },
2045e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
2055e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
2065e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                              // TONE_CDMA_REORDER
2075e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 250, waveFreq: { 480, 620, 0 }, 0, 0 },
2085e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 250, waveFreq: { 0 }, 0, 0 },
2095e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
2105e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 7,
2115e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                              // TONE_CDMA_ABBR_REORDER
2125e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 500, waveFreq: { 480, 620, 0 }, 0, 0 },
2135e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 500, waveFreq: { 0 }, 0, 0 },
2145e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
2155e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
2165e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                              // TONE_CDMA_NETWORK_BUSY
2175e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 100, waveFreq: { 350, 440, 0 }, 0, 0 },
2185e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 100, waveFreq: { 0 }, 0, 0 },
2195e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
2205e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 2,
2215e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                              // TONE_CDMA_CONFIRM
222981594f5c3697c3330bdbd4bb5a743fb9f01e6abNaveen Kalla        { segments: { { duration: 500, waveFreq: { 660, 1000, 0 }, 0, 0 },
223981594f5c3697c3330bdbd4bb5a743fb9f01e6abNaveen Kalla                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
2245e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 0,
2255e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                              // TONE_CDMA_ANSWER
2265e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 300, waveFreq: { 440, 0 }, 0, 0 },
2275e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
2285e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 0,
2295e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                              // TONE_CDMA_NETWORK_CALLWAITING
2305e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 100, waveFreq: { 480, 0 }, 0, 0 },
2315e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 100, waveFreq: { 0 }, 0, 0 },
2325e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
2335e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 3,
2345e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                              // TONE_CDMA_PIP
2355e0a3043af16bc71a4211ee00dc00724de6623a7David Krause
2365e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 32, waveFreq: { 2091, 0}, 0, 0 },
2375e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 64, waveFreq: { 2556, 0}, 19, 0},
2385e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 32, waveFreq: { 2091, 0}, 0, 0},
2395e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 48, waveFreq: { 2556, 0}, 0, 0},
2405e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 4000, waveFreq: { 0 }, 0, 0},
2415e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0,  waveFreq: { 0 }, 0, 0}},
2425e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 0,
2435e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                             // TONE_CDMA_CALL_SIGNAL_ISDN_NORMAL
2445e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 32, waveFreq: { 2091, 0}, 0, 0 },
2455e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 64, waveFreq: { 2556, 0}, 7, 0 },
2465e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 32, waveFreq: { 2091, 0}, 0, 0 },
2475e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 400, waveFreq: { 0 }, 0, 0 },
2485e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 32,  waveFreq: { 2091, 0}, 0, 0 },
2495e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 64,  waveFreq: { 2556, 0}, 7, 4 },
2505e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 32,  waveFreq: { 2091, 0}, 0, 0 },
2515e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 4000, waveFreq: { 0 }, 0, 0 },
2525e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0,    waveFreq: { 0 }, 0, 0 } },
2535e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 0,
2545e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                              // TONE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP
2555e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 32, waveFreq: { 2091, 0}, 0, 0 },
2565e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 64, waveFreq: { 2556, 0}, 3, 0 },
2575e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 16, waveFreq: { 2091, 0}, 0, 0 },
2585e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 },     0, 0 },
2595e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 32, waveFreq: { 2091, 0}, 0, 0 },
2605e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 64, waveFreq: { 2556, 0}, 3, 4 },
2615e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 16, waveFreq: { 2091, 0}, 0, 0 },
2625e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 },     0, 0 },
2635e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0,   waveFreq: { 0 },     0, 0 } },
2645e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 0,
2655e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                            // TONE_CDMA_CALL_SIGNAL_ISDN_SP_PRI
2665e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 0,  waveFreq: { 0 }, 0, 0} },
267e53b9ead781c36e96d6b6f012ddffc93a3d80f0dGlenn Kasten          repeatCnt: 0,
268e53b9ead781c36e96d6b6f012ddffc93a3d80f0dGlenn Kasten          repeatSegment: 0 },                            // TONE_CDMA_CALL_SIGNAL_ISDN_PAT3
2695e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 32, waveFreq: { 2091, 0 }, 0, 0 },
2705e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 64, waveFreq: { 2556, 0 }, 4, 0 },
2715e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 20, waveFreq: { 2091, 0 }, 0, 0 },
2725e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0,  waveFreq: { 0 }      , 0, 0 } },
2735e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 0,
2745e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                             // TONE_CDMA_CALL_SIGNAL_ISDN_PING_RING
2755e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 0,  waveFreq: { 0 }, 0, 0} },
2765e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 0,
2775e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                             // TONE_CDMA_CALL_SIGNAL_ISDN_PAT5
2785e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 0,  waveFreq: { 0 }, 0, 0} },
2795e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 0,
2805e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                             // TONE_CDMA_CALL_SIGNAL_ISDN_PAT6
2815e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 0,  waveFreq: { 0 }, 0, 0} },
2825e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 0,
2835e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                             // TONE_CDMA_CALL_SIGNAL_ISDN_PAT7
2845e0a3043af16bc71a4211ee00dc00724de6623a7David Krause
2855e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
2865e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 39, 0 },
2875e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 4000, waveFreq: { 0 },     0, 0 },
2885e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0,    waveFreq: { 0 },     0, 0 } },
2895e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
2905e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_HIGH_L
2915e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
2925e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 39, 0 },
2935e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 4000, waveFreq: { 0 },     0, 0 },
2945e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0,    waveFreq: { 0 },     0, 0 } },
2955e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
2965e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_MED_L
2975e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
2985e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 39, 0 },
2995e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 4000, waveFreq: { 0 },     0, 0 },
3005e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0,    waveFreq: { 0 },     0, 0 } },
3015e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
3025e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_LOW_L
3035e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
3045e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 15, 0 },
3055e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 400, waveFreq: { 0 }, 0, 0 },
3065e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 } },
3075e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
3085e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_HIGH_SS
3095e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
3105e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 15, 0 },
3115e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 400, waveFreq: { 0 }, 0, 0 },
3125e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
3135e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
3145e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_MED_SS
3155e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
3165e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 15, 0 },
3175e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 400, waveFreq: { 0 }, 0, 0 },
3185e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
3195e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
3205e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_LOW_SS
3215e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
3225e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 7, 0 },
3235e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
3245e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
3255e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 7, 3 },
3265e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
3275e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
3285e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 15, 6 },
3295e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 4000, waveFreq: { 0 }, 0, 0 },
3305e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
3315e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
3325e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_HIGH_SSL
3335e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
3345e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 7, 0 },
3355e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
3365e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
3375e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 7, 3 },
3385e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
3395e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
3405e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 15, 6 },
3415e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 4000, waveFreq: { 0 }, 0, 0 },
3425e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
3435e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
3445e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_MED_SSL
3455e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
3465e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 7, 0 },
3475e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
3485e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
3495e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 7, 3 },
3505e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
3515e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
3525e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 15, 6 },
3535e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 4000, waveFreq: { 0 }, 0, 0 },
3545e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
3555e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
3565e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_LOW_SSL
3575e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
3585e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 19, 0 },
3595e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 1000, waveFreq: { 0 }, 0, 0 },
3605e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
3615e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 19, 3 },
3625e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 3000, waveFreq: { 0 }, 0, 0 },
3635e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
3645e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
3655e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_HIGH_SS_2
3665e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
3675e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 19, 0 },
3685e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 1000, waveFreq: { 0 }, 0, 0 },
3695e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
3705e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 19, 3 },
3715e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 3000, waveFreq: { 0 }, 0, 0 },
3725e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
3735e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
3745e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_MED_SS_2
3755e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
3765e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 19, 0 },
3775e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 1000, waveFreq: { 0 }, 0, 0 },
3785e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
3795e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 19, 3 },
3805e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 3000, waveFreq: { 0 }, 0, 0 },
3815e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
3825e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
3835e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_LOW_SS_2
3845e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
3855e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 9, 0 },
3865e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 500, waveFreq: { 0 }, 0, 0 },
3875e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
3885e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 19, 3 },
3895e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 500, waveFreq: { 0 }, 0, 0 },
3905e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
3915e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 9, 6 },
3925e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 3000, waveFreq: { 0 }, 0, 0 },
3935e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
3945e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
3955e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_HIGH_SLS
3965e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
3975e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 9, 0 },
3985e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 500, waveFreq: { 0 }, 0, 0 },
3995e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
4005e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 19, 3 },
4015e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 500, waveFreq: { 0 }, 0, 0 },
4025e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
4035e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 9, 6 },
4045e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 3000, waveFreq: { 0 }, 0, 0 },
4055e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
4065e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
4075e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_MED_SLS
4085e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
4095e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 9, 0 },
4105e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 500, waveFreq: { 0 }, 0, 0 },
4115e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
4125e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 19, 3 },
4135e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 500, waveFreq: { 0 }, 0, 0 },
4145e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
4155e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 9, 6 },
4165e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 3000, waveFreq: { 0 }, 0, 0 },
4175e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
4185e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
4195e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_LOW_SLS
4205e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
4215e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 9, 0 },
4225e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 500, waveFreq: { 0 }, 0, 0 },
4235e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
4245e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 9, 3 },
4255e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 500, waveFreq: { 0 }, 0, 0 },
4265e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
4275e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 9, 6 },
4285e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 500, waveFreq: { 0 }, 0, 0 },
4295e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
4305e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 9, 9 },
4315e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 2500, waveFreq: { 0 }, 0, 0 },
4325e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
4335e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
4345e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_HIGH_S_X4
4355e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
4365e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 9, 0 },
4375e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 500, waveFreq: { 0 }, 0, 0 },
4385e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
4395e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 9, 3 },
4405e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 500, waveFreq: { 0 }, 0, 0 },
4415e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
4425e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 9, 6 },
4435e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 500, waveFreq: { 0 }, 0, 0 },
4445e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
4455e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 9, 9 },
4465e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 2500, waveFreq: { 0 }, 0, 0 },
4475e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
4485e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
4495e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_MED_S_X4
4505e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
4515e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 9, 0 },
4525e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 500, waveFreq: { 0 }, 0, 0 },
4535e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
4545e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 9, 3 },
4555e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 500, waveFreq: { 0 }, 0, 0 },
4565e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
4575e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 9, 6 },
4585e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 500, waveFreq: { 0 }, 0, 0 },
4595e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
4605e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 9, 9 },
4615e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 2500, waveFreq: { 0 }, 0, 0 },
4625e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
4635e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
4645e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_LOW_S_X4
4655e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
4665e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 19, 0 },
4675e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 2000, waveFreq: { 0 }, 0, 0 },
4685e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
4695e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
4705e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_HIGH_PBX_L
4715e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
4725e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 19, 0 },
4735e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 2000, waveFreq: { 0 }, 0, 0 },
4745e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
4755e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
4765e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_MED_PBX_L
4775e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
4785e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 19, 0 },
4795e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 2000, waveFreq: { 0 }, 0, 0 },
4805e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
4815e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
4825e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_LOW_PBX_L
4835e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
4845e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 7, 0 },
4855e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
4865e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
4875e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 7, 3 },
4885e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 2000, waveFreq: { 0 }, 0, 0 },
4895e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
4905e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
4915e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_HIGH_PBX_SS
4925e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
4935e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 7, 0 },
4945e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
4955e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
4965e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 7, 3 },
4975e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 2000, waveFreq: { 0 }, 0, 0 },
4985e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
4995e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
5005e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_MED_PBX_SS
5015e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
5025e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 7, 0 },
5035e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
5045e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
5055e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 7, 3 },
5065e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 2000, waveFreq: { 0 }, 0, 0 },
5075e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
5085e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
5095e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_LOW_PBX_SS
5105e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
5115e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 7, 0 },
5125e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
5135e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
5145e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 7, 3 },
5155e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
5165e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
5175e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 15, 6 },
5185e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 1000, waveFreq: { 0 }, 0, 0 },
5195e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
5205e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
5215e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_HIGH_PBX_SSL
5225e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
5235e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 7, 0 },
5245e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
5255e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
5265e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 7, 3 },
5275e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
5285e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
5295e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 15, 6 },
5305e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 1000, waveFreq: { 0 }, 0, 0 },
5315e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
5325e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
5335e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_MED_PBX_SSL
5345e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
5355e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 7, 0 },
5365e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
5375e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
5385e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 7, 3 },
5395e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
5405e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
5415e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 15, 6 },
5425e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 1000, waveFreq: { 0 }, 0, 0 },
5435e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
5445e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
5455e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_LOW_PBX_SSL
5465e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
5475e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 7, 0 },
5485e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
5495e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
5505e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 15, 3 },
5515e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
5525e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
5535e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 7, 6 },
5545e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 1000, waveFreq: { 0 }, 0, 0 },
5555e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
5565e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
5575e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_HIGH_PBX_SLS
5585e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
5595e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 7, 0 },
5605e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
5615e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
5625e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 15, 3 },
5635e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
5645e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
5655e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 7, 6 },
5665e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 1000, waveFreq: { 0 }, 0, 0 },
5675e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
5685e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
5695e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_MED_PBX_SLS
5705e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
5715e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 7, 0 },
5725e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
5735e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
5745e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 15, 3 },
5755e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
5765e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
5775e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 7, 6 },
5785e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 1000, waveFreq: { 0 }, 0, 0 },
5795e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
5805e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
5815e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_LOW_PBX_SLS
5825e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
5835e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 7, 0 },
5845e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
5855e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
5865e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 7, 3 },
5875e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
5885e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
5895e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 7, 6 },
5905e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
5915e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 3700, 0 }, 0, 0 },
5925e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 4000, 0 }, 7, 9 },
5935e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 800, waveFreq: { 0 }, 0, 0 },
5945e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
5955e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
5965e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_HIGH_PBX_S_X4
5975e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
5985e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 7, 0 },
5995e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
6005e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
6015e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 7, 3 },
6025e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
6035e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
6045e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 7, 6 },
6055e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
6065e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2600, 0 }, 0, 0 },
6075e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 2900, 0 }, 7, 9 },
6085e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 800, waveFreq: { 0 }, 0, 0 },
6095e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
6105e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
6115e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_MED_PBX_S_X4
6125e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
6135e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 7, 0 },
6145e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
6155e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
6165e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 7, 3 },
6175e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
6185e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
6195e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 7, 6 },
6205e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 200, waveFreq: { 0 }, 0, 0 },
6215e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1300, 0 }, 0, 0 },
6225e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 25, waveFreq: { 1450, 0 }, 7, 9 },
6235e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 800, waveFreq: { 0 }, 0, 0 },
6245e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
6255e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
6265e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_LOW_PBX_S_X4
6275e0a3043af16bc71a4211ee00dc00724de6623a7David Krause
6285e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 62, waveFreq: { 1109, 0 }, 0, 0 },
6295e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 62, waveFreq: { 784, 0 },  0, 0 },
6305e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 62, waveFreq: { 740, 0 },  0, 0 },
6315e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 62, waveFreq: { 622, 0 },  0, 0 },
6325e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 62, waveFreq: { 1109, 0 }, 0, 0 },
6335e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0,  waveFreq: { 0 },       0, 0 } },
6345e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 0,
6355e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                            // TONE_CDMA_ALERT_NETWORK_LITE
6365e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 62, waveFreq: { 1245, 0 }, 0, 0 },
6375e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 62, waveFreq: { 659, 0 },  2, 0 },
6385e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 62, waveFreq: { 1245, 0 }, 0, 0 },
6395e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0,  waveFreq: { 0 },       0, 0 } },
6405e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 0,
6415e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                            // TONE_CDMA_ALERT_AUTOREDIAL_LITE
6425e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 400, waveFreq: { 1150, 770, 0 }, 0, 0 },
6435e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0,   waveFreq: { 0 },            0, 0 } },
6445e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 0,
6455e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                            // TONE_CDMA_ONE_MIN_BEEP
6465e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 120, waveFreq: { 941, 1477, 0 }, 0, 0 },
6475e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0,   waveFreq: { 0 },            0, 0 } },
6485e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 0,
6495e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                            // TONE_CDMA_KEYPAD_VOLUME_KEY_LITE
6505e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 375, waveFreq: { 587, 0 }, 0, 0 },
6515e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 125, waveFreq: { 1175, 0 }, 0, 0 },
6525e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0,   waveFreq: { 0 },       0, 0 } },
6535e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 0,
6545e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                            // TONE_CDMA_PRESSHOLDKEY_LITE
6555e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 62, waveFreq: { 587, 0 }, 0, 0 },
6565e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 62, waveFreq: { 784, 0 }, 0, 0 },
6575e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 62, waveFreq: { 831, 0 }, 0, 0 },
6585e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 62, waveFreq: { 784, 0 }, 0, 0 },
6595e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 62, waveFreq: { 1109, 0 }, 0, 0 },
6605e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 62, waveFreq: { 784, 0 }, 0, 0 },
6615e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 62, waveFreq: { 831, 0 }, 0, 0 },
6625e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 62, waveFreq: { 784, 0 }, 0, 0 },
6635e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0,  waveFreq: { 0 },      0, 0 } },
6645e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 0,
6655e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                             // TONE_CDMA_ALERT_INCALL_LITE
6665e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 125, waveFreq: { 941, 0 }, 0, 0 },
6675e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 10,  waveFreq: { 0 },      2, 0 },
6685e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 4990, waveFreq: { 0 },     0, 0 },
6695e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0,    waveFreq: { 0 },     0, 0 } },
6705e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: ToneGenerator::TONEGEN_INF,
6715e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                            // TONE_CDMA_EMERGENCY_RINGBACK
6725e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 125, waveFreq: { 1319, 0 }, 0, 0 },
6735e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 125, waveFreq: { 0 },       0, 0 },
6745e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0,   waveFreq: { 0 },       0, 0 } },
6755e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 2,
6765e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                            // TONE_CDMA_ALERT_CALL_GUARD
6775e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 125, waveFreq: { 1047, 0 }, 0, 0 },
6785e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 125, waveFreq: { 370,  0 }, 0, 0 },
6795e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0,   waveFreq: { 0 },       0, 0 } },
6805e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 0,
6815e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                            // TONE_CDMA_SOFT_ERROR_LITE
6825e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 125, waveFreq: { 1480, 0 }, 0, 0 },
6835e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 125, waveFreq: { 1397, 0 }, 0, 0 },
6845e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 125, waveFreq: { 784, 0 },  0, 0 },
6855e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0,   waveFreq: { 0 },       0, 0 } },
6865e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 0,
6875e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                            // TONE_CDMA_CALLDROP_LITE
6885e0a3043af16bc71a4211ee00dc00724de6623a7David Krause
6895e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 500, waveFreq: { 425, 0 }, 0, 0 },
6905e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 500, waveFreq: { 0 }, 0, 0 },
6915e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
6925e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 0,
6935e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_NETWORK_BUSY_ONE_SHOT
6945e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 400, waveFreq: { 1150, 770 }, 0, 0 },
6955e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0, waveFreq: { 0 }, 0, 0 }},
6965e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 0,
6975e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                           // TONE_CDMA_ABBR_ALERT
6985e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          { segments: { { duration: 0, waveFreq: { 0 }, 0, 0 }},
6995e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatCnt: 0,
7005e0a3043af16bc71a4211ee00dc00724de6623a7David Krause          repeatSegment: 0 },                            // TONE_CDMA_SIGNAL_OFF
7015e0a3043af16bc71a4211ee00dc00724de6623a7David Krause
7025e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 350, 440, 0 }, 0, 0 },
7035e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
7040b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
7050b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_ANSI_DIAL
7065e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 500, waveFreq: { 480, 620, 0 }, 0, 0 },
7075e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 500, waveFreq: { 0 }, 0, 0 },
7085e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
7090b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
7100b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_ANSI_BUSY
7115e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 250, waveFreq: { 480, 620, 0 }, 0, 0 },
7125e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 250, waveFreq: { 0 }, 0, 0 },
7135e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
7140b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
7150b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_ANSI_CONGESTION
7165e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 300, waveFreq: { 440, 0 }, 0, 0 },
7175e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 9700, waveFreq: { 0 }, 0, 0 },
7185e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 100, waveFreq: { 440, 0 }, 0, 0 },
7195e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 100, waveFreq: { 0 }, 0, 0 },
7205e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 100, waveFreq: { 440, 0 }, 0, 0 },
7215e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
7220b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
7230b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 1 },                              // TONE_ANSI_CALL_WAITING
7245e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 2000, waveFreq: { 440, 480, 0 }, 0, 0 },
7255e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 4000, waveFreq: { 0 }, 0, 0 },
7265e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
7270b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
7280b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_ANSI_RINGTONE
7295e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 400, 0 }, 0, 0 },
7305e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
7310b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
7320b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_JAPAN_DIAL
7335e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 500, waveFreq: { 400, 0 }, 0, 0 },
7345e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 500, waveFreq: { 0 }, 0, 0 },
7355e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
7360b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
7370b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_JAPAN_BUSY
7385e0a3043af16bc71a4211ee00dc00724de6623a7David Krause        { segments: { { duration: 1000, waveFreq: { 400, 0 }, 0, 0 },
7395e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 2000, waveFreq: { 0 }, 0, 0 },
7405e0a3043af16bc71a4211ee00dc00724de6623a7David Krause                      { duration: 0 , waveFreq: { 0 }, 0, 0}},
7410b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatCnt: ToneGenerator::TONEGEN_INF,
7420b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent          repeatSegment: 0 },                              // TONE_JAPAN_RADIO_ACK
7435e0a3043af16bc71a4211ee00dc00724de6623a7David Krause
7445e0a3043af16bc71a4211ee00dc00724de6623a7David Krause
7455e0a3043af16bc71a4211ee00dc00724de6623a7David Krause
7460b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent};
7470b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent
7480b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent// Used by ToneGenerator::getToneForRegion() to convert user specified supervisory tone type
7490b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent// to actual tone for current region.
7503d2f877c1cb4e4ae4ddde7f57f4353de9341f11bGlenn Kastenconst unsigned char /*tone_type*/ ToneGenerator::sToneMappingTable[NUM_REGIONS-1][NUM_SUP_TONES] = {
7510b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent        {   // ANSI
7520b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent            TONE_ANSI_DIAL,             // TONE_SUP_DIAL
7530b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent            TONE_ANSI_BUSY,             // TONE_SUP_BUSY
7540b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent            TONE_ANSI_CONGESTION,       // TONE_SUP_CONGESTION
7550b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent            TONE_SUP_RADIO_ACK,         // TONE_SUP_RADIO_ACK
7560b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent            TONE_SUP_RADIO_NOTAVAIL,    // TONE_SUP_RADIO_NOTAVAIL
7570b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent            TONE_SUP_ERROR,             // TONE_SUP_ERROR
7580b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent            TONE_ANSI_CALL_WAITING,     // TONE_SUP_CALL_WAITING
7590b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent            TONE_ANSI_RINGTONE          // TONE_SUP_RINGTONE
7600b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent        },
7610b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent        {   // JAPAN
7620b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent            TONE_JAPAN_DIAL,             // TONE_SUP_DIAL
7630b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent            TONE_JAPAN_BUSY,             // TONE_SUP_BUSY
7640b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent            TONE_SUP_CONGESTION,         // TONE_SUP_CONGESTION
7650b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent            TONE_JAPAN_RADIO_ACK,        // TONE_SUP_RADIO_ACK
7660b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent            TONE_SUP_RADIO_NOTAVAIL,     // TONE_SUP_RADIO_NOTAVAIL
7670b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent            TONE_SUP_ERROR,              // TONE_SUP_ERROR
7680b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent            TONE_SUP_CALL_WAITING,       // TONE_SUP_CALL_WAITING
7690b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent            TONE_SUP_RINGTONE            // TONE_SUP_RINGTONE
7700b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent        }
7710b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent};
7720b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent
77389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
77489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project////////////////////////////////////////////////////////////////////////////////
77589fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//                           ToneGenerator class Implementation
77689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project////////////////////////////////////////////////////////////////////////////////
77789fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
77889fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
77989fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//---------------------------------- public methods ----------------------------
78089fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
78189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
78289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project////////////////////////////////////////////////////////////////////////////////
78389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//
78489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//    Method:        ToneGenerator::ToneGenerator()
78589fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//
78689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//    Description:    Constructor. Initializes the tone sequencer, intantiates required sine wave
78789fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//        generators, instantiates output audio track.
78889fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//
78989fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//    Input:
79099e53b86eebb605b70dd7591b89bf61a9414ed0eGlenn Kasten//        streamType:        Type of stream used for tone playback
79189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//        volume:            volume applied to tone (0.0 to 1.0)
79289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//
79389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//    Output:
79489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//        none
79589fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//
79689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project////////////////////////////////////////////////////////////////////////////////
797fff6d715a8db0daf08a50634f242c40268de3d49Glenn KastenToneGenerator::ToneGenerator(audio_stream_type_t streamType, float volume, bool threadCanCallJava) {
79889fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
79990bebef5669a9385c706b042d146a31dca2e5d9bGlenn Kasten    ALOGV("ToneGenerator constructor: streamType=%d, volume=%f", streamType, volume);
80089fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
80189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    mState = TONE_IDLE;
80289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
80389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    if (AudioSystem::getOutputSamplingRate(&mSamplingRate, streamType) != NO_ERROR) {
80429357bc2c0dd7c43ad3bd0c8e3efa4e6fd9bfd47Steve Block        ALOGE("Unable to marshal AudioFlinger");
80589fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project        return;
80689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    }
80734f1d8ecd23169a5f299937e3aaf1bd7937578a0Eric Laurent    mThreadCanCallJava = threadCanCallJava;
80889fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    mStreamType = streamType;
80989fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    mVolume = volume;
810a0d68338a88c2ddb4502f95017b546d603ef1ec7Glenn Kasten    mpToneDesc = NULL;
811a0d68338a88c2ddb4502f95017b546d603ef1ec7Glenn Kasten    mpNewToneDesc = NULL;
81289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    // Generate tone by chunks of 20 ms to keep cadencing precision
81389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    mProcessSize = (mSamplingRate * 20) / 1000;
81489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
8150b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent    char value[PROPERTY_VALUE_MAX];
8160b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent    property_get("gsm.operator.iso-country", value, "");
8170b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent    if (strcmp(value,"us") == 0 ||
8180b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent        strcmp(value,"ca") == 0) {
8190b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent        mRegion = ANSI;
8200b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent    } else if (strcmp(value,"jp") == 0) {
8210b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent        mRegion = JAPAN;
8220b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent    } else {
8230b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent        mRegion = CEPT;
8240b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent    }
8250b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent
82689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    if (initAudioTrack()) {
82790bebef5669a9385c706b042d146a31dca2e5d9bGlenn Kasten        ALOGV("ToneGenerator INIT OK, time: %d", (unsigned int)(systemTime()/1000000));
82889fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    } else {
82990bebef5669a9385c706b042d146a31dca2e5d9bGlenn Kasten        ALOGV("!!!ToneGenerator INIT FAILED!!!");
83089fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    }
83189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project}
83289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
83389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
83489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
83589fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
83689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project////////////////////////////////////////////////////////////////////////////////
83789fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//
83889fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//    Method:        ToneGenerator::~ToneGenerator()
83989fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//
84089fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//    Description:    Destructor. Stop sound playback and delete audio track if
84189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//      needed and delete sine wave generators.
84289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//
84389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//    Input:
84489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//        none
84589fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//
84689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//    Output:
84789fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//        none
84889fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//
84989fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project////////////////////////////////////////////////////////////////////////////////
85089fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source ProjectToneGenerator::~ToneGenerator() {
85190bebef5669a9385c706b042d146a31dca2e5d9bGlenn Kasten    ALOGV("ToneGenerator destructor");
85289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
8532799d743ee2ae5a25fe869a7f9c052acc029559fGlenn Kasten    if (mpAudioTrack != 0) {
85489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project        stopTone();
8552799d743ee2ae5a25fe869a7f9c052acc029559fGlenn Kasten        ALOGV("Delete Track: %p", mpAudioTrack.get());
8562799d743ee2ae5a25fe869a7f9c052acc029559fGlenn Kasten        mpAudioTrack.clear();
85789fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    }
85889fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project}
85989fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
86089fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project////////////////////////////////////////////////////////////////////////////////
86189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//
86289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//    Method:        ToneGenerator::startTone()
86389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//
86489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//    Description:    Starts tone playback.
86589fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//
86689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//    Input:
86785fa14d35468acca07ce0085d67b909f673fae07Eric Laurent//        toneType:        Type of tone generated (values in enum tone_type)
86885fa14d35468acca07ce0085d67b909f673fae07Eric Laurent//        durationMs:      The tone duration in milliseconds. If the tone is limited in time by definition,
86985fa14d35468acca07ce0085d67b909f673fae07Eric Laurent//              the actual duration will be the minimum of durationMs and the defined tone duration.
87085fa14d35468acca07ce0085d67b909f673fae07Eric Laurent//              Ommiting or setting durationMs to -1 does not limit tone duration.
87189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//
87289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//    Output:
87389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//        none
87489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//
87589fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project////////////////////////////////////////////////////////////////////////////////
8763d2f877c1cb4e4ae4ddde7f57f4353de9341f11bGlenn Kastenbool ToneGenerator::startTone(tone_type toneType, int durationMs) {
87789fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    bool lResult = false;
878e33e00e931d1381d402484aa5cde67e540e3c82cEric Laurent    status_t lStatus;
87989fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
8804afdfa7fd7e9fe59fb298ef2ac252686e68bc73aDave Sparks    if ((toneType < 0) || (toneType >= NUM_TONES))
88189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project        return lResult;
88289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
8836eb954f54e4a92b3c4bfbee177a3259d1320500dEric Laurent    toneType = getToneForRegion(toneType);
8846eb954f54e4a92b3c4bfbee177a3259d1320500dEric Laurent    if (toneType == TONE_CDMA_SIGNAL_OFF) {
8856eb954f54e4a92b3c4bfbee177a3259d1320500dEric Laurent        return true;
8866eb954f54e4a92b3c4bfbee177a3259d1320500dEric Laurent    }
8876eb954f54e4a92b3c4bfbee177a3259d1320500dEric Laurent
88889fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    if (mState == TONE_IDLE) {
8893856b090cd04ba5dd4a59a12430ed724d5995909Steve Block        ALOGV("startTone: try to re-init AudioTrack");
89089fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project        if (!initAudioTrack()) {
89189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project            return lResult;
89289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project        }
89389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    }
89489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
89590bebef5669a9385c706b042d146a31dca2e5d9bGlenn Kasten    ALOGV("startTone");
89689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
89789fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    mLock.lock();
89889fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
89989fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    // Get descriptor for requested tone
9000b62e242d112d46e9357242b0a4e11c720c98ca0Eric Laurent    mpNewToneDesc = &sToneDescriptors[toneType];
90189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
902e33e00e931d1381d402484aa5cde67e540e3c82cEric Laurent    mDurationMs = durationMs;
903e33e00e931d1381d402484aa5cde67e540e3c82cEric Laurent
904e33e00e931d1381d402484aa5cde67e540e3c82cEric Laurent    if (mState == TONE_STOPPED) {
9053856b090cd04ba5dd4a59a12430ed724d5995909Steve Block        ALOGV("Start waiting for previous tone to stop");
906a9a4390989072d579eedab6b71fb41248b3ad8feEric Laurent        lStatus = mWaitCbkCond.waitRelative(mLock, seconds(3));
907e33e00e931d1381d402484aa5cde67e540e3c82cEric Laurent        if (lStatus != NO_ERROR) {
90829357bc2c0dd7c43ad3bd0c8e3efa4e6fd9bfd47Steve Block            ALOGE("--- start wait for stop timed out, status %d", lStatus);
909e33e00e931d1381d402484aa5cde67e540e3c82cEric Laurent            mState = TONE_IDLE;
910a9a4390989072d579eedab6b71fb41248b3ad8feEric Laurent            mLock.unlock();
911e33e00e931d1381d402484aa5cde67e540e3c82cEric Laurent            return lResult;
91285fa14d35468acca07ce0085d67b909f673fae07Eric Laurent        }
91385fa14d35468acca07ce0085d67b909f673fae07Eric Laurent    }
91485fa14d35468acca07ce0085d67b909f673fae07Eric Laurent
91589fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    if (mState == TONE_INIT) {
91689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project        if (prepareWave()) {
91790bebef5669a9385c706b042d146a31dca2e5d9bGlenn Kasten            ALOGV("Immediate start, time %d", (unsigned int)(systemTime()/1000000));
91889fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project            lResult = true;
91989fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project            mState = TONE_STARTING;
920681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent            if (clock_gettime(CLOCK_MONOTONIC, &mStartTime) != 0) {
921681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent                mStartTime.tv_sec = 0;
922681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent            }
92389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project            mLock.unlock();
92489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project            mpAudioTrack->start();
92589fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project            mLock.lock();
92689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project            if (mState == TONE_STARTING) {
9273856b090cd04ba5dd4a59a12430ed724d5995909Steve Block                ALOGV("Wait for start callback");
928a9a4390989072d579eedab6b71fb41248b3ad8feEric Laurent                lStatus = mWaitCbkCond.waitRelative(mLock, seconds(3));
9298365529381f6284f2d59dcc38e26f73adeec9c67The Android Open Source Project                if (lStatus != NO_ERROR) {
93029357bc2c0dd7c43ad3bd0c8e3efa4e6fd9bfd47Steve Block                    ALOGE("--- Immediate start timed out, status %d", lStatus);
93189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project                    mState = TONE_IDLE;
93289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project                    lResult = false;
93389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project                }
93489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project            }
93589fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project        } else {
9365a22b909c9e8fc0d9321dcc014706a790b26b971Eric Laurent            mState = TONE_IDLE;
93789fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project        }
93889fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    } else {
93990bebef5669a9385c706b042d146a31dca2e5d9bGlenn Kasten        ALOGV("Delayed start");
94089fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project        mState = TONE_RESTARTING;
941681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent        mStartTime.tv_sec = 0;
942a9a4390989072d579eedab6b71fb41248b3ad8feEric Laurent        lStatus = mWaitCbkCond.waitRelative(mLock, seconds(3));
9438365529381f6284f2d59dcc38e26f73adeec9c67The Android Open Source Project        if (lStatus == NO_ERROR) {
94489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project            if (mState != TONE_IDLE) {
94589fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project                lResult = true;
94689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project            }
9473856b090cd04ba5dd4a59a12430ed724d5995909Steve Block            ALOGV("cond received");
94889fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project        } else {
94929357bc2c0dd7c43ad3bd0c8e3efa4e6fd9bfd47Steve Block            ALOGE("--- Delayed start timed out, status %d", lStatus);
95089fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project            mState = TONE_IDLE;
95189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project        }
95289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    }
95389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    mLock.unlock();
95489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
95590bebef5669a9385c706b042d146a31dca2e5d9bGlenn Kasten    ALOGV_IF(lResult, "Tone started, time %d", (unsigned int)(systemTime()/1000000));
95690bebef5669a9385c706b042d146a31dca2e5d9bGlenn Kasten    ALOGW_IF(!lResult, "Tone start failed!!!, time %d", (unsigned int)(systemTime()/1000000));
95789fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
95889fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    return lResult;
95989fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project}
96089fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
96189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project////////////////////////////////////////////////////////////////////////////////
96289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//
96389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//    Method:        ToneGenerator::stopTone()
96489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//
96589fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//    Description:    Stops tone playback.
96689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//
96789fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//    Input:
96889fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//        none
96989fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//
97089fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//    Output:
97189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//        none
97289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project//
97389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project////////////////////////////////////////////////////////////////////////////////
97489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Projectvoid ToneGenerator::stopTone() {
9753856b090cd04ba5dd4a59a12430ed724d5995909Steve Block    ALOGV("stopTone");
97689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
97789fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project    mLock.lock();
97809108adeca8cbbf3fbb21f8aea2a2ff250db9531Eric Laurent    if (mState != TONE_IDLE && mState != TONE_INIT) {
97909108adeca8cbbf3fbb21f8aea2a2ff250db9531Eric Laurent        if (mState == TONE_PLAYING || mState == TONE_STARTING || mState == TONE_RESTARTING) {
980681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent            struct timespec stopTime;
981681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent            // If the start time is valid, make sure that the number of audio samples produced
982681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent            // corresponds at least to the time between the start and stop commands.
983681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent            // This is needed in case of cold start of the output stream.
984a8eccec73a40d4afcff505eb463a016c89aeed42Eric Laurent            if ((mStartTime.tv_sec != 0) && (clock_gettime(CLOCK_MONOTONIC, &stopTime) == 0)) {
985681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent                time_t sec = stopTime.tv_sec - mStartTime.tv_sec;
986681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent                long nsec = stopTime.tv_nsec - mStartTime.tv_nsec;
987681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent                long durationMs;
988681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent                if (nsec < 0) {
989681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent                    --sec;
990681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent                    nsec += 1000000000;
991681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent                }
992681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent
993681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent                if ((sec + 1) > ((long)(INT_MAX / mSamplingRate))) {
994681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent                    mMaxSmp = sec * mSamplingRate;
995681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent                } else {
996681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent                    // mSamplingRate is always > 1000
997681be0398a06da7e24db4ed934a92af64d1409b1Eric Laurent                    sec = sec * 1000 + nsec / 1000000; // duration in milliseconds
998a8eccec73a40d4afcff505eb463a016c89aeed42Eric Laurent                    mMaxSmp = (unsigned int)(((int64_t)sec * mSamplingRate) / 1000);
999