*state = client->current_state;
switch (*state) {
- case STT_STATE_CREATED: SLOG(LOG_DEBUG, TAG_STTC, "Current state is 'CREATED'"); break;
- case STT_STATE_READY: SLOG(LOG_DEBUG, TAG_STTC, "Current state is 'Ready'"); break;
- case STT_STATE_RECORDING: SLOG(LOG_DEBUG, TAG_STTC, "Current state is 'Recording'"); break;
- case STT_STATE_PROCESSING: SLOG(LOG_DEBUG, TAG_STTC, "Current state is 'Processing'"); break;
- default: SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid value"); break;
+ case STT_STATE_CREATED: SLOG(LOG_DEBUG, TAG_STTC, "Current state is 'CREATED'"); break;
+ case STT_STATE_READY: SLOG(LOG_DEBUG, TAG_STTC, "Current state is 'Ready'"); break;
+ case STT_STATE_RECORDING: SLOG(LOG_DEBUG, TAG_STTC, "Current state is 'Recording'"); break;
+ case STT_STATE_PROCESSING: SLOG(LOG_DEBUG, TAG_STTC, "Current state is 'Processing'"); break;
+ default: SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid value"); break;
}
return STT_ERROR_NONE;
*state = client->current_state;
switch (*state) {
- case STT_FILE_STATE_NONE: SLOG(LOG_DEBUG, TAG_STTFC, "Current state is 'NONE'"); break;
- case STT_FILE_STATE_READY: SLOG(LOG_DEBUG, TAG_STTFC, "Current state is 'Ready'"); break;
- case STT_FILE_STATE_PROCESSING: SLOG(LOG_DEBUG, TAG_STTFC, "Current state is 'Processing'"); break;
- default: SLOG(LOG_ERROR, TAG_STTFC, "[ERROR] Invalid value"); break;
+ case STT_FILE_STATE_NONE: SLOG(LOG_DEBUG, TAG_STTFC, "Current state is 'NONE'"); break;
+ case STT_FILE_STATE_READY: SLOG(LOG_DEBUG, TAG_STTFC, "Current state is 'Ready'"); break;
+ case STT_FILE_STATE_PROCESSING: SLOG(LOG_DEBUG, TAG_STTFC, "Current state is 'Processing'"); break;
+ default: SLOG(LOG_ERROR, TAG_STTFC, "[ERROR] Invalid value"); break;
}
return STT_FILE_ERROR_NONE;
const char* __stt_get_focus_changed_reason_code(sound_stream_focus_change_reason_e reason)
{
switch (reason) {
- case SOUND_STREAM_FOCUS_CHANGED_BY_MEDIA: return "SOUND_STREAM_FOCUS_CHANGED_BY_MEDIA";
- case SOUND_STREAM_FOCUS_CHANGED_BY_SYSTEM: return "SOUND_STREAM_FOCUS_CHANGED_BY_SYSTEM";
- case SOUND_STREAM_FOCUS_CHANGED_BY_ALARM: return "SOUND_STREAM_FOCUS_CHANGED_BY_ALARM";
- case SOUND_STREAM_FOCUS_CHANGED_BY_NOTIFICATION: return "SOUND_STREAM_FOCUS_CHANGED_BY_NOTIFICATION";
- case SOUND_STREAM_FOCUS_CHANGED_BY_EMERGENCY: return "SOUND_STREAM_FOCUS_CHANGED_BY_EMERGENCY";
- case SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_INFORMATION: return "SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_INFORMATION";
- case SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_RECOGNITION: return "SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_RECOGNITION";
- case SOUND_STREAM_FOCUS_CHANGED_BY_RINGTONE: return "SOUND_STREAM_FOCUS_CHANGED_BY_RINGTONE";
- case SOUND_STREAM_FOCUS_CHANGED_BY_VOIP: return "SOUND_STREAM_FOCUS_CHANGED_BY_VOIP";
- case SOUND_STREAM_FOCUS_CHANGED_BY_CALL: return "SOUND_STREAM_FOCUS_CHANGED_BY_CALL";
- case SOUND_STREAM_FOCUS_CHANGED_BY_MEDIA_EXTERNAL_ONLY: return "SOUND_STREAM_FOCUS_CHANGED_BY_MEDIA_EXTERNAL_ONLY";
- default: return "Undefined reason code";
+ case SOUND_STREAM_FOCUS_CHANGED_BY_MEDIA: return "SOUND_STREAM_FOCUS_CHANGED_BY_MEDIA";
+ case SOUND_STREAM_FOCUS_CHANGED_BY_SYSTEM: return "SOUND_STREAM_FOCUS_CHANGED_BY_SYSTEM";
+ case SOUND_STREAM_FOCUS_CHANGED_BY_ALARM: return "SOUND_STREAM_FOCUS_CHANGED_BY_ALARM";
+ case SOUND_STREAM_FOCUS_CHANGED_BY_NOTIFICATION: return "SOUND_STREAM_FOCUS_CHANGED_BY_NOTIFICATION";
+ case SOUND_STREAM_FOCUS_CHANGED_BY_EMERGENCY: return "SOUND_STREAM_FOCUS_CHANGED_BY_EMERGENCY";
+ case SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_INFORMATION: return "SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_INFORMATION";
+ case SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_RECOGNITION: return "SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_RECOGNITION";
+ case SOUND_STREAM_FOCUS_CHANGED_BY_RINGTONE: return "SOUND_STREAM_FOCUS_CHANGED_BY_RINGTONE";
+ case SOUND_STREAM_FOCUS_CHANGED_BY_VOIP: return "SOUND_STREAM_FOCUS_CHANGED_BY_VOIP";
+ case SOUND_STREAM_FOCUS_CHANGED_BY_CALL: return "SOUND_STREAM_FOCUS_CHANGED_BY_CALL";
+ case SOUND_STREAM_FOCUS_CHANGED_BY_MEDIA_EXTERNAL_ONLY: return "SOUND_STREAM_FOCUS_CHANGED_BY_MEDIA_EXTERNAL_ONLY";
+ default: return "Undefined reason code";
}
}
audio_in_h temp_in_h;
switch (channel) {
- case 1: audio_ch = AUDIO_CHANNEL_MONO; break;
- case 2: audio_ch = AUDIO_CHANNEL_STEREO; break;
- default:
- SLOG(LOG_ERROR, TAG_STTD, "[Recorder ERROR] Input channel is not supported");
- return STTD_ERROR_OPERATION_FAILED;
- break;
+ case 1: audio_ch = AUDIO_CHANNEL_MONO; break;
+ case 2: audio_ch = AUDIO_CHANNEL_STEREO; break;
+ default:
+ SLOG(LOG_ERROR, TAG_STTD, "[Recorder ERROR] Input channel is not supported");
+ return STTD_ERROR_OPERATION_FAILED;
+ break;
}
switch (type) {
- case STTP_AUDIO_TYPE_PCM_S16_LE: audio_type = AUDIO_SAMPLE_TYPE_S16_LE; break;
- case STTP_AUDIO_TYPE_PCM_U8: audio_type = AUDIO_SAMPLE_TYPE_U8; break;
- default:
- SLOG(LOG_ERROR, TAG_STTD, "[Recorder ERROR] Invalid Audio Type");
- return STTD_ERROR_OPERATION_FAILED;
- break;
+ case STTP_AUDIO_TYPE_PCM_S16_LE: audio_type = AUDIO_SAMPLE_TYPE_S16_LE; break;
+ case STTP_AUDIO_TYPE_PCM_U8: audio_type = AUDIO_SAMPLE_TYPE_U8; break;
+ default:
+ SLOG(LOG_ERROR, TAG_STTD, "[Recorder ERROR] Invalid Audio Type");
+ return STTD_ERROR_OPERATION_FAILED;
+ break;
}
int ret;