Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentations and instructions for android integration needed #5

Closed
toan-t-le opened this issue Jan 18, 2021 · 20 comments
Closed

Documentations and instructions for android integration needed #5

toan-t-le opened this issue Jan 18, 2021 · 20 comments
Assignees

Comments

@toan-t-le
Copy link

I believe the android example under opensmile\progsrc\android-template is in a non-working state right now with just the adapter and placeholder folder for the library. Do you have any plan to create a working example project to show how to utilize the built .aar file?

I tried the Linux and Windows builds out and they worked fine but the documentations for android is somewhat lacking. There was no further instruction for android after the build step

Extracting your first features section only shows how to use SMILExtract using command line.

I have a .conf file and I'm looking for a way to pass that to the library (together with .wav input file) in android to get back data just like the first example of that section

SMILExtract -C config/demo/demo1_energy.conf -I example-audio/opensmile.wav -O opensmile.energy.csv

Digging into the template project, I do found some methods defined under OpenSmileAdapter. Could you please describe what those methods do and how I can get the results?

@chausner
Copy link

chausner commented Jan 18, 2021

The Android sample should be in a working state. @hesamsagha can probably give you some hints how to get started with the Android integration.

@toan-t-le
Copy link
Author

toan-t-le commented Jan 19, 2021

Thank you for the quick response

When I try to build on Mac, I encounter an error about command 'sed' finished with non-zero exit value 1 when I attempted the very first step of build instruction

First, in order to build the Java SWIG files, install swig first, and then run:
./gradlew opensmile:swig

which made subsequent post-fixing command not working

    commandLine 'sed', '-i',
            's/(data == 0) ? null : new SWIGTYPE_p_float(data, false)/data/g',
            'src/main/java/com/audeering/opensmile/OpenSMILEJNI.java'

the build script auto-generate the OpenSmileJNI.java file but without the post-fixing step, the type will be conflicting. I believe
jself.onCalledExternalSinkCallback((data == 0) ? null : new SWIGTYPE_p_float(data, false)) needed to be changed to jself.onCalledExternalSinkCallback(data)

@hesamsagha
Copy link
Member

you may comment out this part of the gradle and replace the string manually.

@toan-t-le
Copy link
Author

After replacing that in the JNI wrapper classes generated by swig, I successfully built the aar file. The android template project couldn't find the aar file generated under android-template\opensmile\build\outputs so I added some code to load the aar file separately. Everything in OpenSmileExamples.kt resolved and I was able to launch the sample app but nothing works. Clicking on any of the 5 test buttons would result in error initialize failed! and the other 3 would result in crashes. Do you have any insights what could've gone wrong with my approaches?

@chausner-audeering
Copy link
Contributor

@hesamsagha Any idea what could be going wrong here?

@hesamsagha
Copy link
Member

@toankrw could you check the logcat and copy it here.

@atul56
Copy link

atul56 commented Feb 8, 2021

After downloading this file "opensmile-3.0-win-x64"
what to do to install opensmile in windows 10, plz guide

@toan-t-le
Copy link
Author

toan-t-le commented Feb 15, 2021

After trying again with another desktop running Ubuntu16.04, all the build steps seem to work.

A comment on the issue:

On MacOS, it would fail at step command sed probably because the behavior of that command might be different from Linux. Also, one of my co-worker mentioned it was a good thing an error was throw because it could have gone through without any error flagged in some cases and the end results will be different, which could be disastrous for debugging. This might be why upon successfully built the library on Mac, it still didn't run. I think this should be noted in the documentation for other devs to know.

@toan-t-le
Copy link
Author

Upon launching the app (without any modification to build procedure), I encounter the same error like before. Here is the logcat:

When clicking "Test ExternalMessageInterface":

2021-02-15 14:10:38.362 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] commandlineParser: about to parse 1 commandline options 
2021-02-15 14:10:38.365 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] cComponentManager: 1 of 99 components requested re-register in round 1
2021-02-15 14:10:38.365 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] cComponentManager: 1 of 99 components requested re-register in round 2
2021-02-15 14:10:38.366 4482-4482/com.audeering.androidtemplate I/opensmile: (MSG) [2] cComponentManager: successfully registered 99 component types.
2021-02-15 14:10:38.366 4482-4482/com.audeering.androidtemplate I/opensmile: (WRN) [3] cComponentManager: cannot open plugin directory './plugins' for reading! You can ignore this if you are not using openSMILE plugins.
2021-02-15 14:10:38.366 4482-4482/com.audeering.androidtemplate I/opensmile: (MSG) [3] configManager: trying to read config file from disk: '/data/user/0/com.audeering.androidtemplate/cache//testsmilemessage.conf'
2021-02-15 14:10:38.366 4482-4482/com.audeering.androidtemplate I/opensmile: (MSG) [3] configManager: successfully opened file '/data/user/0/com.audeering.androidtemplate/cache//testsmilemessage.conf', loading it.
2021-02-15 14:10:38.366 4482-4482/com.audeering.androidtemplate I/opensmile: (MSG) [3] configManager: successfully read config file '/data/user/0/com.audeering.androidtemplate/cache//testsmilemessage.conf'
2021-02-15 14:10:38.366 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] commandlineParser: about to parse 1 commandline options 
2021-02-15 14:10:38.366 4482-4482/com.audeering.androidtemplate I/opensmile: (ERR) [0] commandlineParser: parse: unknown option '-nologfile' on commandline!
2021-02-15 14:10:38.367 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] cComponentManager: found 10 component instances in config to create.
2021-02-15 14:10:38.367 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] cComponentManager:  adding 0. component instance: name 'dataMemory', type 'cDataMemory', configInstance 'dataMemory'
2021-02-15 14:10:38.367 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] cComponentManager: addComponent: instname='dataMemory' type='cDataMemory'
2021-02-15 14:10:38.367 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] cComponentManager:  adding 1. component instance: name 'waveIn', type 'cOpenslesSource', configInstance 'waveIn'
2021-02-15 14:10:38.367 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] cComponentManager: addComponent: instname='waveIn' type='cOpenslesSource'
2021-02-15 14:10:38.367 4482-4482/com.audeering.androidtemplate I/opensmile: (ERR) [1] cComponentManager: cannot add component (instname='waveIn' type='cOpenslesSource'): unknown component type!!
2021-02-15 14:10:38.367 4482-4482/com.audeering.androidtemplate I/opensmile: (ERR) [1] cComponentManager: error during addComponent (returnVal=-1)!
2021-02-15 14:10:38.367 4482-4482/com.audeering.androidtemplate I/EXTDATASOURCE: initialize failed!

When clicking "Test ExternalSink":

2021-02-15 14:11:31.526 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] commandlineParser: about to parse 1 commandline options 
2021-02-15 14:11:31.530 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] cComponentManager: 1 of 99 components requested re-register in round 1
2021-02-15 14:11:31.530 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] cComponentManager: 1 of 99 components requested re-register in round 2
2021-02-15 14:11:31.530 4482-4482/com.audeering.androidtemplate I/opensmile: (MSG) [2] cComponentManager: successfully registered 99 component types.
2021-02-15 14:11:31.530 4482-4482/com.audeering.androidtemplate I/opensmile: (WRN) [3] cComponentManager: cannot open plugin directory './plugins' for reading! You can ignore this if you are not using openSMILE plugins.
2021-02-15 14:11:31.530 4482-4482/com.audeering.androidtemplate I/opensmile: (MSG) [3] configManager: trying to read config file from disk: '/data/user/0/com.audeering.androidtemplate/cache//testexternalsink.conf'
2021-02-15 14:11:31.530 4482-4482/com.audeering.androidtemplate I/opensmile: (MSG) [3] configManager: successfully opened file '/data/user/0/com.audeering.androidtemplate/cache//testexternalsink.conf', loading it.
2021-02-15 14:11:31.530 4482-4482/com.audeering.androidtemplate I/opensmile: (MSG) [3] configManager: successfully read config file '/data/user/0/com.audeering.androidtemplate/cache//testexternalsink.conf'
2021-02-15 14:11:31.531 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] commandlineParser: about to parse 1 commandline options 
2021-02-15 14:11:31.531 4482-4482/com.audeering.androidtemplate I/opensmile: (ERR) [0] commandlineParser: parse: unknown option '-nologfile' on commandline!
2021-02-15 14:11:31.531 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] cComponentManager: found 9 component instances in config to create.
2021-02-15 14:11:31.531 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] cComponentManager:  adding 0. component instance: name 'dataMemory', type 'cDataMemory', configInstance 'dataMemory'
2021-02-15 14:11:31.531 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] cComponentManager: addComponent: instname='dataMemory' type='cDataMemory'
2021-02-15 14:11:31.531 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] cComponentManager:  adding 1. component instance: name 'waveIn', type 'cOpenslesSource', configInstance 'waveIn'
2021-02-15 14:11:31.531 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] cComponentManager: addComponent: instname='waveIn' type='cOpenslesSource'
2021-02-15 14:11:31.531 4482-4482/com.audeering.androidtemplate I/opensmile: (ERR) [1] cComponentManager: cannot add component (instname='waveIn' type='cOpenslesSource'): unknown component type!!
2021-02-15 14:11:31.531 4482-4482/com.audeering.androidtemplate I/opensmile: (ERR) [1] cComponentManager: error during addComponent (returnVal=-1)!
2021-02-15 14:11:31.531 4482-4482/com.audeering.androidtemplate I/EXTSINK: initialize failed!

One side question, do I load a sample audio file to sdcard/output_external.wav? I found the sample app request record audio feature and the class RecordMic using the path as output and "Test External Recording" button looks like it should trigger a recording and write to the file. However, there's a "initialize failed!" response as well:

2021-02-15 14:16:39.967 4482-4482/com.audeering.androidtemplate I/opensmile params:: -O -> /sdcard/output_external.wav
2021-02-15 14:16:39.967 4482-4482/com.audeering.androidtemplate I/opensmile params:: nologfile -> (null)
2021-02-15 14:16:39.967 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] commandlineParser: about to parse 3 commandline options 
2021-02-15 14:16:39.970 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] cComponentManager: 1 of 99 components requested re-register in round 1
2021-02-15 14:16:39.970 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] cComponentManager: 1 of 99 components requested re-register in round 2
2021-02-15 14:16:39.970 4482-4482/com.audeering.androidtemplate I/opensmile: (MSG) [2] cComponentManager: successfully registered 99 component types.
2021-02-15 14:16:39.970 4482-4482/com.audeering.androidtemplate I/opensmile: (WRN) [3] cComponentManager: cannot open plugin directory './plugins' for reading! You can ignore this if you are not using openSMILE plugins.
2021-02-15 14:16:39.970 4482-4482/com.audeering.androidtemplate I/opensmile: (MSG) [3] configManager: trying to read config file from disk: '/data/user/0/com.audeering.androidtemplate/cache//testexternalaudio.conf'
2021-02-15 14:16:39.970 4482-4482/com.audeering.androidtemplate I/opensmile: (MSG) [3] configManager: successfully opened file '/data/user/0/com.audeering.androidtemplate/cache//testexternalaudio.conf', loading it.
2021-02-15 14:16:39.970 4482-4482/com.audeering.androidtemplate I/opensmile: (MSG) [3] configManager: successfully read config file '/data/user/0/com.audeering.androidtemplate/cache//testexternalaudio.conf'
2021-02-15 14:16:39.970 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] commandlineParser: about to parse 3 commandline options 
2021-02-15 14:16:39.970 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] commandlineParser: about to parse 3 commandline options 
2021-02-15 14:16:39.970 4482-4482/com.audeering.androidtemplate I/opensmile: (ERR) [0] commandlineParser: parse: unknown option '-nologfile' on commandline!
2021-02-15 14:16:39.970 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] cComponentManager: found 3 component instances in config to create.
2021-02-15 14:16:39.970 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] cComponentManager:  adding 0. component instance: name 'dataMemory', type 'cDataMemory', configInstance 'dataMemory'
2021-02-15 14:16:39.970 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] cComponentManager: addComponent: instname='dataMemory' type='cDataMemory'
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] cComponentManager:  adding 1. component instance: name 'waveSink', type 'cWaveSink', configInstance 'waveSink'
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (MSG) [1] cComponentManager: [componentManager] threadId of instance waveSink must be < nThreads (1). Setting to threadId 0.
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] cComponentManager: addComponent: instname='waveSink' type='cWaveSink'
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] instance 'waveSink.reader': reading from 1 input levels
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] instance 'waveSink.reader': forceAsyncMerge = 0
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] instance 'waveSink.reader': errorOnFullInputIncomplete = 1
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] instance 'waveSink.reader': input level 0 = 'data'
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] instance 'waveSink': blocksizeR (sec.) = 1.000000
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] instance 'waveSink': filename = '/sdcard/output_external.wav'
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] instance 'waveSink': sampleFormat = '16bit'
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] cComponentManager:  adding 2. component instance: name 'externalAudioSource', type 'cExternalAudioSource', configInstance 'externalAudioSource'
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] cComponentManager: addComponent: instname='externalAudioSource' type='cExternalAudioSource'
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] instance 'externalAudioSource': buffersize (sec.) = 0.000000
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] instance 'externalAudioSource': buffersize (frames.) = 0
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] instance 'externalAudioSource': blocksizeW (sec.) = 0.050000
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] instance 'externalAudioSource': blocksizeW (frames, from config only) = 25600
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] cComponentManager: ==> createInstances: REGISTER PHASE (components) <==
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] cComponentManager:     3 instances in total (max. 2 iterations)
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] dataMemory: registerReadRequest: registered read request for level 'data' by component instance 'waveSink.reader'
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] cComponentManager: registered component instance 'waveSink' (type 'cWaveSink'), index 1
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] dataMemory: registerWriteRequest: registered write request for level 'data' by component instance 'externalAudioSource.writer'
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] cComponentManager: registered component instance 'externalAudioSource' (type 'cExternalAudioSource'), index 2
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (MSG) [3] cComponentManager: successfully registered 2 of 2 component instances (non dataMemory type)
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] cComponentManager: ==> createInstances: REGISTER PHASE (dataMemories) <==
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] cComponentManager:     3 instances in total (max. 2 iterations)
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] cComponentManager: registered component instance 'dataMemory' (type 'cDataMemory'), index 0
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (MSG) [3] cComponentManager: successfully registered 1 of 1 dataMemory instances
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] cComponentManager: ==> createInstances: CONFIGURE PHASE (components) <==
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] cComponentManager:     3 instances in total (max. 4 iterations)
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] instance 'waveSink.reader': level='data' not yet available, waiting!
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] cComponentManager: component instance 'waveSink' (type 'cWaveSink'), index 1, could not be configured (yet)
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] instance 'externalAudioSource': using default buffersize 100 because buffersize or buffersize_sec was not set in config!
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] cComponentManager: configured component instance 'externalAudioSource' (type 'cExternalAudioSource'), index 2
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] cComponentManager: configured component instance 'externalAudioSource' (type 'cExternalAudioSource'), index 2
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] cComponentManager: need to re-configure 1 components after iteration 0
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [3] cComponentManager: configured component instance 'waveSink' (type 'cWaveSink'), index 1
2021-02-15 14:16:39.971 4482-4482/com.audeering.androidtemplate I/opensmile: (DBG) [2] instance 'waveSink.reader': registered reader level[i=0]=0 ('data'), rdId=0
2021-02-15 14:16:39.974 4482-4482/com.audeering.androidtemplate I/opensmile: (ERR) [1] cWaveSink: failed to open output file '/sdcard/output_external.wav'
2021-02-15 14:16:39.975 4482-4482/com.audeering.androidtemplate I/EXTAUDIOSOURCE: initialize failed!

@hesamsagha
Copy link
Member

@toankrw The error
cannot add component (instname='waveIn' type='cOpenslesSource'): unknown component type!!
means that the openSmile has not been built with the cOpenslesSource component. This component is necessary to capture audio in the Android. To add it, you should add your flags in the gradle.properties before compiling opensmile; this line:


example: BUILD_FLAGS="-DWITH_OPENSLES=ON"
Other build flags you can also add, some of them are listed in the https://github.com/audeering/opensmile/blob/master/build_flags.sh

Regarding the audio, the app will write the recorded audio or csv into a file, with the default paths mentioned in


If it has problem with writing, either the permission is not granted or the folder doesn't exist. You may change the default values to fix it.

@toan-t-le
Copy link
Author

toan-t-le commented Feb 16, 2021

Thanks for the insights, the crashes seem to derive from permission changes come with Android 11. Even though the app requests for READ and WRITE permissions, the only thing granted was "Allow access to media only". The issue was further discussed here:

laurent22/joplin#4122

I will try a workaround and let you know the result so you can apply the fix to sample app.

About the hiccup I encountered previously, before I attempted the build on a desktop running Ubuntu 16.04, I tried with a VM running 19.04 (Disco Dingo) build. Do you have any idea why it would fail at the final step /gradlew app:assembleUseSource?

> Task :opensmile:compileDebugKotlin FAILED
e: /home/toankrw/Downloads/opensmile-master/progsrc/android-template/opensmile/src/main/java/com/audeering/opensmile/OpenSmileAdapter.kt: (13, 36): Unresolved reference: SWIGTYPE_p_smileobj_t_
e: /home/toankrw/Downloads/opensmile-master/progsrc/android-template/opensmile/src/main/java/com/audeering/opensmile/OpenSmileAdapter.kt: (15, 29): Unresolved reference: OpenSMILE
e: /home/toankrw/Downloads/opensmile-master/progsrc/android-template/opensmile/src/main/java/com/audeering/opensmile/OpenSmileAdapter.kt: (18, 13): Unresolved reference: OpenSMILE
e: /home/toankrw/Downloads/opensmile-master/progsrc/android-template/opensmile/src/main/java/com/audeering/opensmile/OpenSmileAdapter.kt: (21, 13): Unresolved reference: OpenSMILE
e: /home/toankrw/Downloads/opensmile-master/progsrc/android-template/opensmile/src/main/java/com/audeering/opensmile/OpenSmileAdapter.kt: (24, 13): Unresolved reference: OpenSMILE
e: /home/toankrw/Downloads/opensmile-master/progsrc/android-template/opensmile/src/main/java/com/audeering/opensmile/OpenSmileAdapter.kt: (27, 13): Unresolved reference: OpenSMILE
e: /home/toankrw/Downloads/opensmile-master/progsrc/android-template/opensmile/src/main/java/com/audeering/opensmile/OpenSmileAdapter.kt: (33, 47): Unresolved reference: smileres_t
e: /home/toankrw/Downloads/opensmile-master/progsrc/android-template/opensmile/src/main/java/com/audeering/opensmile/OpenSmileAdapter.kt: (35, 20): Unresolved reference: OpenSMILE
e: /home/toankrw/Downloads/opensmile-master/progsrc/android-template/opensmile/src/main/java/com/audeering/opensmile/OpenSmileAdapter.kt: (36, 16): Unresolved reference: OpenSMILE
e: /home/toankrw/Downloads/opensmile-master/progsrc/android-template/opensmile/src/main/java/com/audeering/opensmile/OpenSmileAdapter.kt: (42, 58): Unresolved reference: CallbackExternalMessageInterfaceJson
e: /home/toankrw/Downloads/opensmile-master/progsrc/android-template/opensmile/src/main/java/com/audeering/opensmile/OpenSmileAdapter.kt: (44, 13): Unresolved reference: OpenSMILE
e: /home/toankrw/Downloads/opensmile-master/progsrc/android-template/opensmile/src/main/java/com/audeering/opensmile/OpenSmileAdapter.kt: (48, 21): Unresolved reference: CallbackExternalMessageInterfaceJson
e: /home/toankrw/Downloads/opensmile-master/progsrc/android-template/opensmile/src/main/java/com/audeering/opensmile/OpenSmileAdapter.kt: (52, 63): Unresolved reference: CallbackExternalSink
e: /home/toankrw/Downloads/opensmile-master/progsrc/android-template/opensmile/src/main/java/com/audeering/opensmile/OpenSmileAdapter.kt: (54, 13): Unresolved reference: OpenSMILE
e: /home/toankrw/Downloads/opensmile-master/progsrc/android-template/opensmile/src/main/java/com/audeering/opensmile/OpenSmileAdapter.kt: (58, 21): Unresolved reference: CallbackExternalSink
e: /home/toankrw/Downloads/opensmile-master/progsrc/android-template/opensmile/src/main/java/com/audeering/opensmile/OpenSmileAdapter.kt: (61, 25): Unresolved reference: OpenSMILE
e: /home/toankrw/Downloads/opensmile-master/progsrc/android-template/opensmile/src/main/java/com/audeering/opensmile/OpenSmileAdapter.kt: (63, 25): Unresolved reference: OpenSMILE
e: /home/toankrw/Downloads/opensmile-master/progsrc/android-template/opensmile/src/main/java/com/audeering/opensmile/OpenSmileAdapter.kt: (65, 24): Unresolved reference: OpenSMILE
e: /home/toankrw/Downloads/opensmile-master/progsrc/android-template/opensmile/src/main/java/com/audeering/opensmile/OpenSmileAdapter.kt: (67, 23): Unresolved reference: OpenSMILE

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':opensmile:compileDebugKotlin'.
> Compilation error. See log for more details

The first step ./gradlew opensmile:swig went through just fine but it wasn't able to resolve the variables from the generated JNI

@hesamsagha
Copy link
Member

I am not sure why. Usually this error relates to the unsuccessful swig process, when it can't produce the output. Does this happen only on the VM with Ubuntu 19.04? Is a proper swig version installed?

@toan-t-le
Copy link
Author

toan-t-le commented Mar 5, 2021

I only had the problem with 19.04. I had to change apt-get address to archive.ubuntu.com and there were some other hiccups so I probably did something wrong while setting up that VM.

Here is the addition to AndroidManifest to prevent the app from crashing on newer model devices because the demo app is targeting Android 10

android:requestLegacyExternalStorage="true"

More about the issue here: https://developer.android.com/training/data-storage/use-cases?authuser=1#opt-out-scoped-storage

Without that the app won't be able to access the external directory even though the permissions were granted

@krishna51119
Copy link

I am trying to use opensmile 3.0 in python in windows 10. Downloaded from official website. Extract the folder, in cmd change working directory to opensmile\bin\SMILExtract -h
then it says installation is done as I can see the version and other details.

Finally for feature extraction

C:\Users\HP\Desktop\opensmile\bin>SMILExtract -C config -I opensmile.wav -O F.csv

(MSG) [2] SMILExtract: openSMILE starting!
(MSG) [2] SMILExtract: config file is: config
(MSG) [2] cComponentManager: successfully registered 103 component types.
(ERR) [1] configManager: cFileConfigReader::openInput : cannot find input file 'config'!

please somebody guide. This is the issue with cmd, but when i try in python editor it generates the csv file but its not readable. some unknown font appear.
Regards

@toan-t-le
Copy link
Author

@krishna51119 I think the path to your config file is wrong, double check the part -C config

@krishna51119
Copy link

@toankrw the path should be the path of this config file right?
I have given that path only, opensmile is stored in Desktop in that folder config>mfcc>MFCC12_0_D_A.conf
actually i wrote this.

what else is needed? plz guide

@chausner-audeering
Copy link
Contributor

Here is the addition to AndroidManifest to prevent the app from crashing on newer model devices because the demo app is targeting Android 10

@toankrw Thank you for pointing out this breaking change and the workaround. We should indeed set this variable in the Android sample project.

@krishna51119 Please open a new issue for your question. Thanks!

@toan-t-le
Copy link
Author

@krishna51119 you should put the path config>mfcc>MFCC12_0_D_A.conf to the command, not just 'config', use absolute path if needed

C:\Users\HP\Desktop\opensmile\bin>SMILExtract -C PATH_TO_CONFIG -I PATH_TO_INPUT_WAV -O OUTPUT_PATH

@toan-t-le
Copy link
Author

I think the feedback has been received and minor issues with the app crashing have been resolved as well. I'm closing this issue

@m-canabal
Copy link

Same issue on win 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants