Start a new topic

SDcard audio path is not working in Android JS file Wikitude SDK

SDcard audio path is not working in Android JS file Wikitude SDK


I have store the Audio file in Sdcard using webService. So When I want to access the audio file path from SDcard it was not playing it. Same for WTC and Video path is working I don't know Why audio file is  not working

Please Help me out !!!

 

Best Regards,

Yogesh

Is anyone who can help me out?

 

Best Regards,

Yogesh


 

Hi there!

Your issue is a general WebView issue, please check out e.g. stackoverflow to get more details about how to access files from an SDK card on Android.
Using it via WebView is a bit challenging, you may need to pass over "sd-card root folder" from native to JS environment upfront.

http://stackoverflow.com/questions/5473601/webview-cannot-load-html-file-from-sd-card

best regards

Hi Andreas,

Thanks for the Reply.

I have check this Url "http://stackoverflow.com/questions/5473601/webview-cannot-load-html-file-from-sd-card" and added the path like this but still its not working at my end.

I have download the below mention files in the SD-Card with this Path:-
1) Audio File:- /storage/sdcard0/Testing/mysound.mp3
2) WTC File:- /storage/sdcard0/Testing/butterfly.wtc
3) Video File:- /storage/sdcard0/Testing/video.mp4
4) Animation Image File:-/storage/sdcard0/Testing/butterfly.png

When I am calling WTC File, Video File Or Animation Image File from Java-Script using same path then its working I just need to add this string "file://" at first but when I am working with Audio its not working I have also added the Java-Script File Code for Audio file so Please check & let me know where I am doing wrong.

loadAudio:function()
{
    sound1 = new AR.Sound("file:///storage/sdcard0/Testing/mysound.mp3",
    {
        onLoaded : function()
        {
            sound1.play();
        },
        onError : function()
        {
        },
    });
}    

If I am adding Audio Url instead of Sd-Card Audio Path then its working only its not working for Sd-Card.
Please help me waiting for your reply.

Best Regards,
Yogesh
 

Hi again!

Note that the path to the sd-card varies depending on the device and OS.
I recommend to use relative paths only, so you e.g. load the experience from SD-card or application's assets folder and access any asset via relative path then 
Login or Signup to post a comment