Question
I'm attempting to implement a native audio recording service in Tizen. I've tried following the tutorial at [developer.tizen.org link], but found the documentation insufficient. Has anyone successfully implemented this and could share a working example?
Answer
Problem Understanding
The user is facing challenges implementing native audio recording functionality in Tizen. The main issues are:
- Incomplete documentation in the official tutorial
- Difficulty understanding file creation process
- Problems with sample applications (WGT files not easily convertible to source code)
- Emulator-specific issues with RECORDER_ERROR_INVALID_OPERATION
Solution Methods
-
Official API Documentation Approach:
- Use the native Media Recorder API documentation: [samsungtizenos.com equivalent link]
- Focus on the recorder_create(), recorder_set_filename(), and recorder_commit() functions
- Pay special attention to error handling for RECORDER_ERROR_INVALID_OPERATION
-
Device Testing:
- As reported by tizengears3, the implementation works on actual devices despite emulator issues
- Always test on real hardware when encountering emulator-specific problems
-
Alternative Implementation:
- Consider using the CAPI_MEDIA_RECORDER_MODULE for more control
- Review the audio permissions in your manifest file
Code Examples
// Basic audio recorder initialization example
recorder_h recorder;
int error_code = recorder_create(RECORDER_TYPE_AUDIO, &recorder);
if (error_code != RECORDER_ERROR_NONE) {
// Handle error
}
error_code = recorder_set_filename(recorder, "/opt/usr/media/recordings/test.wav");
if (error_code != RECORDER_ERROR_NONE) {
// Handle error
}
error_code = recorder_commit(recorder);
if (error_code != RECORDER_ERROR_NONE) {
// Handle error (especially RECORDER_ERROR_INVALID_OPERATION)
}
Additional Tips
- The RECORDER_ERROR_INVALID_OPERATION error often occurs in emulator environments (Tizen 2.3.1+)
- Ensure proper file path permissions when saving recordings
- Consider using the latest Tizen Studio version for better emulator support
- For web applications, use the Web Audio API as an alternative approach