I have a Web app (javascript) running on Tizen OS watches (Samsung Watch)
I use audiocontrol.recorder to record a sound file from watch’s microphone.
It writes the amr file to folder “/home/owner/media/Sounds” by default
so the file is at “/home/owner/media/Sounds/test.amr”
After writing the file I need to access it because I will send it to a service.
So I was able to access with following code:
tizen.filesystem.resolve(
'/home/owner/media/test.amr',
function onMusicResolved(file) {
var uri = file.toURI();
ftSend(uri);
},
function onMusicResolveError(error) {
console.error('audio resolve error', error.name);
},
'r'
);
This was working on Tizen 2.3
Yes, I know the file in the resolve function is missing the “Sounds” folder , but it was working.
But on Tizen 4.0 it does not work.
I receive a “InvalidValuesError” from “tizen.filesystem.resolve” method.
How should I change my code to adapt to Tizen 4.0 required format ?
My function “ftSend” is expecting the file in URI format.
Because it then sends it to companion app with SAAgent’s gAgent.getSAFileTransfer() , sendFile() function.