Loading media/libaudioclient/ToneGenerator.cpp +17 −0 Original line number Diff line number Diff line Loading @@ -867,6 +867,11 @@ const ToneGenerator::ToneDescriptor ToneGenerator::sToneDescriptors[] = { { .duration = 0 , .waveFreq = { 0 }, 0, 0}}, .repeatCnt = ToneGenerator::TONEGEN_INF, .repeatSegment = 0 }, // TONE_TW_RINGTONE { .segments = { { .duration = 200, .waveFreq = { 400, 0 }, 0, 0 }, { .duration = 3000, .waveFreq = { 0 }, 0, 0 }, { .duration = 0 , .waveFreq = { 0 }, 0, 0}}, .repeatCnt = 3, .repeatSegment = 0 }, // TONE_NZ_CALL_WAITING }; // Used by ToneGenerator::getToneForRegion() to convert user specified supervisory tone type Loading Loading @@ -961,6 +966,16 @@ const unsigned char /*tone_type*/ ToneGenerator::sToneMappingTable[NUM_REGIONS-1 TONE_SUP_ERROR, // TONE_SUP_ERROR TONE_SUP_CALL_WAITING, // TONE_SUP_CALL_WAITING TONE_TW_RINGTONE // TONE_SUP_RINGTONE }, { // NEW ZEALAND TONE_JAPAN_DIAL, // TONE_SUP_DIAL TONE_JAPAN_BUSY, // TONE_SUP_BUSY TONE_SUP_CONGESTION, // TONE_SUP_CONGESTION TONE_SUP_RADIO_ACK, // TONE_SUP_RADIO_ACK TONE_SUP_RADIO_NOTAVAIL, // TONE_SUP_RADIO_NOTAVAIL TONE_SUP_ERROR, // TONE_SUP_ERROR TONE_NZ_CALL_WAITING, // TONE_SUP_CALL_WAITING TONE_GB_RINGTONE // TONE_SUP_RINGTONE } }; Loading Loading @@ -1038,6 +1053,8 @@ ToneGenerator::ToneGenerator(audio_stream_type_t streamType, float volume, bool mRegion = INDIA; } else if (strstr(value, "tw") != NULL) { mRegion = TAIWAN; } else if (strstr(value, "nz") != NULL) { mRegion = NZ; } else { mRegion = CEPT; } Loading media/libaudioclient/include/media/ToneGenerator.h +5 −0 Original line number Diff line number Diff line Loading @@ -225,7 +225,11 @@ private: TONE_INDIA_CONGESTION, // Congestion tone: 400 Hz, 250ms ON, 250ms OFF... TONE_INDIA_CALL_WAITING, // Call waiting tone: 400 Hz, tone repeated in a 0.2s on, 0.1s off, 0.2s on, 7.5s off pattern. TONE_INDIA_RINGTONE, // Ring tone: 400 Hz tone modulated with 25Hz, 0.4 on 0.2 off 0.4 on 2..0 off // TAIWAN supervisory tones TONE_TW_RINGTONE, // Ring Tone: 440 Hz + 480 Hz repeated with pattern 1s on, 3s off. // NEW ZEALAND supervisory tones TONE_NZ_CALL_WAITING, // Call waiting tone: 400 Hz, 0.2s ON, 3s OFF, // 0.2s ON, 3s OFF, 0.2s ON, 3s OFF, 0.2s ON NUM_ALTERNATE_TONES }; Loading @@ -239,6 +243,7 @@ private: IRELAND, INDIA, TAIWAN, NZ, CEPT, NUM_REGIONS }; Loading Loading
media/libaudioclient/ToneGenerator.cpp +17 −0 Original line number Diff line number Diff line Loading @@ -867,6 +867,11 @@ const ToneGenerator::ToneDescriptor ToneGenerator::sToneDescriptors[] = { { .duration = 0 , .waveFreq = { 0 }, 0, 0}}, .repeatCnt = ToneGenerator::TONEGEN_INF, .repeatSegment = 0 }, // TONE_TW_RINGTONE { .segments = { { .duration = 200, .waveFreq = { 400, 0 }, 0, 0 }, { .duration = 3000, .waveFreq = { 0 }, 0, 0 }, { .duration = 0 , .waveFreq = { 0 }, 0, 0}}, .repeatCnt = 3, .repeatSegment = 0 }, // TONE_NZ_CALL_WAITING }; // Used by ToneGenerator::getToneForRegion() to convert user specified supervisory tone type Loading Loading @@ -961,6 +966,16 @@ const unsigned char /*tone_type*/ ToneGenerator::sToneMappingTable[NUM_REGIONS-1 TONE_SUP_ERROR, // TONE_SUP_ERROR TONE_SUP_CALL_WAITING, // TONE_SUP_CALL_WAITING TONE_TW_RINGTONE // TONE_SUP_RINGTONE }, { // NEW ZEALAND TONE_JAPAN_DIAL, // TONE_SUP_DIAL TONE_JAPAN_BUSY, // TONE_SUP_BUSY TONE_SUP_CONGESTION, // TONE_SUP_CONGESTION TONE_SUP_RADIO_ACK, // TONE_SUP_RADIO_ACK TONE_SUP_RADIO_NOTAVAIL, // TONE_SUP_RADIO_NOTAVAIL TONE_SUP_ERROR, // TONE_SUP_ERROR TONE_NZ_CALL_WAITING, // TONE_SUP_CALL_WAITING TONE_GB_RINGTONE // TONE_SUP_RINGTONE } }; Loading Loading @@ -1038,6 +1053,8 @@ ToneGenerator::ToneGenerator(audio_stream_type_t streamType, float volume, bool mRegion = INDIA; } else if (strstr(value, "tw") != NULL) { mRegion = TAIWAN; } else if (strstr(value, "nz") != NULL) { mRegion = NZ; } else { mRegion = CEPT; } Loading
media/libaudioclient/include/media/ToneGenerator.h +5 −0 Original line number Diff line number Diff line Loading @@ -225,7 +225,11 @@ private: TONE_INDIA_CONGESTION, // Congestion tone: 400 Hz, 250ms ON, 250ms OFF... TONE_INDIA_CALL_WAITING, // Call waiting tone: 400 Hz, tone repeated in a 0.2s on, 0.1s off, 0.2s on, 7.5s off pattern. TONE_INDIA_RINGTONE, // Ring tone: 400 Hz tone modulated with 25Hz, 0.4 on 0.2 off 0.4 on 2..0 off // TAIWAN supervisory tones TONE_TW_RINGTONE, // Ring Tone: 440 Hz + 480 Hz repeated with pattern 1s on, 3s off. // NEW ZEALAND supervisory tones TONE_NZ_CALL_WAITING, // Call waiting tone: 400 Hz, 0.2s ON, 3s OFF, // 0.2s ON, 3s OFF, 0.2s ON, 3s OFF, 0.2s ON NUM_ALTERNATE_TONES }; Loading @@ -239,6 +243,7 @@ private: IRELAND, INDIA, TAIWAN, NZ, CEPT, NUM_REGIONS }; Loading