pxhbug123 / SoxLibInAndroid

8 stars 4 forks source link

the reverse method works neither on an emulator nor on a physical device #4

Closed djewdokimow closed 2 months ago

djewdokimow commented 2 months ago

I would like to reverse the audio file with the following command:

sox input.wav output.wav reverse : restart

The demo app crashes and Logcat prints the results below:

E  can't create temporary file: No such file or directory
A  FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x7abf7a05a8)
A  Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 29073 (RenderThread), pid 29025 (mmandlibandroid)
A  FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x7b7c775d30)

The app crashed because the library could not create an output file. I have tested this library with different SOX commands, and as far as I know, the reverse is the only one resulting in this error.

djewdokimow commented 2 months ago

It turns out it is not your wrapper problem but the system one. I should point to the directory where SoX could create the temporary files, f.e.:

sox /data/data/x.y.z/input.wav /data/data/x.y.z/output.wav --temp /data/data/x.y.z/cache reverse : restart

The important problem - a temporary directory on external storage may not work. It is the reason why I used an inner package in an example. Thank you for creating this project. It saved probably days of my work. I am writing this comment hoping it can help someone.