Hi, I didn’t find a solution yet. From my last finding and using command snap run --shell myapp, I can that libraries from my snap are placed in $SNAP/usr/lib/…/sox and not in /usr/lib/…/sox. This is a problem because in that case sox can’t find its extensions which include pulseaudio driver and mp3 format. I tried to find some way how to point out to correct directory but without success. LD_LIBRARY_PATH didn’t help. Variable was set but play was still not able to find its plugin libraries.
environment: LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox
I still don’t understand how snaps work and how existing Ubuntu libraries can be used. I think only way how to get sox working is to recompile it during snapcraft build phase and change its sox directory to point to correct location with $SNAP root. But this is just my guess. And also I don’t want to use such approach to compile other libraries during build of my app. There should be some easier official way how to get sound command working. sox isn’t only package which can play mp3 files to pulseaudio. The goal here is to keep our snaps small with size close to native deb package. To achieve this we probably need to use gnome extension. But unfortunately it doesn’t work with build system used by my applications. That would probably need hundreds of hours to resolve that. I am not sure if I can devote so much time to this.