Languages

Menu
Sites
Language
audio_in_create() failed! Error: Permission denied [code : -13]

Hi,

 

i cann't find out why i get Permission denied when trying to use audio_in_create on an Gear S3.

I have http :// tizen.org / privilege / recorder as privilage

error_code = audio_in_create(SAMPLE_RATE, AUDIO_CHANNEL_STEREO, AUDIO_SAMPLE_TYPE_S16_LE, &input);

    CHECK_ERROR_AND_RETURN("audio_in_create", error_code); 

 

gives the error

 

other tests like 

 

int error_code = SOUND_MANAGER_ERROR_NONE;

    static sound_stream_type_e sound_stream_type = SOUND_STREAM_TYPE_MEDIA;

    error_code = sound_manager_create_stream_information(sound_stream_type, __focus_callback_audioio, NULL, &g_stream_info_h);

    if (SOUND_MANAGER_ERROR_NONE != error_code)

        dlog_print(DLOG_ERROR, LOG_TAG, "sound_manager_create_stream_information() failed! Error code = 0x%x", error_code);

 

    error_code = sound_manager_set_focus_reacquisition(g_stream_info_h, false);

    if (SOUND_MANAGER_ERROR_NONE != error_code)

        dlog_print(DLOG_ERROR, LOG_TAG, "sound_manager_set_focus_reacquisition() failed! Error code = 0x%x", error_code);

error_code = sound_manager_acquire_focus(g_stream_info_h, SOUND_STREAM_FOCUS_FOR_RECORDING,

                                                      SOUND_BEHAVIOR_NONE, "soundviewer");

    if (SOUND_MANAGER_ERROR_NONE != error_code)

        dlog_print(DLOG_ERROR, LOG_TAG, "sound_manager_acquire_focus() failed! Error code = 0x%x", error_code);

 

all work fine

thanks in advance

 

Maarten

 

Responses

1 Replies
Maarten Weyn

Found the solution.

Besides from setting the permission i had to request the permission in the application

https://developer.tizen.org/development/guides/native-application/security/privacy-related-permissions