Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. How to set up the FMOD audio library in Qt Creator for Android

How to set up the FMOD audio library in Qt Creator for Android

Scheduled Pinned Locked Moved Unsolved Game Development
44 Posts 5 Posters 7.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J JoeCFD
    18 Aug 2023, 15:53

    @8Observer8 said in How to set up the FMOD audio library in Qt Creator for Android:

    ANDROID_EXTRA_LIBS

    I guess
    if your app is built with Qt6, use QT_ANDROID_EXTRA_LIBS.
    Use ANDROID_EXTRA_LIBS for Qt5

    How do I view the contents of an APK file?

    APK files are saved in a compressed .ZIP format and can be opened by any Zip decompression tool. Therefore, if you would like to explore the contents of an APK file, you can rename the file extension to ".zip" and open the file, or you can open the file directly through a Zip application's open dialog box.

    Open or list your apk file to make sure these libs are added in.

    Try the latest Qt6 if you prefer Qt6. Qt-6.2 is new in Qt 6.
    I would prefer to use Qt5 for this. Especially your Android version is so old.

    8 Offline
    8 Offline
    8Observer8
    wrote on 18 Aug 2023, 16:51 last edited by 8Observer8
    #11

    @JoeCFD said in How to set up the FMOD audio library in Qt Creator for Android:

    How do I view the contents of an APK file?

    You can download it here: https://www.dropbox.com/scl/fi/m7hk76cia49451mhsoiny/android-build-with-fmod-for-forums.apk?rlkey=h2cnav1e6bl7s3ixidqi4nnsf&dl=1

    Could you try to run it on your smartphone?

    1 Reply Last reply
    0
    • J JoeCFD
      18 Aug 2023, 15:53

      @8Observer8 said in How to set up the FMOD audio library in Qt Creator for Android:

      ANDROID_EXTRA_LIBS

      I guess
      if your app is built with Qt6, use QT_ANDROID_EXTRA_LIBS.
      Use ANDROID_EXTRA_LIBS for Qt5

      How do I view the contents of an APK file?

      APK files are saved in a compressed .ZIP format and can be opened by any Zip decompression tool. Therefore, if you would like to explore the contents of an APK file, you can rename the file extension to ".zip" and open the file, or you can open the file directly through a Zip application's open dialog box.

      Open or list your apk file to make sure these libs are added in.

      Try the latest Qt6 if you prefer Qt6. Qt-6.2 is new in Qt 6.
      I would prefer to use Qt5 for this. Especially your Android version is so old.

      8 Offline
      8 Offline
      8Observer8
      wrote on 18 Aug 2023, 16:55 last edited by 8Observer8
      #12

      @JoeCFD said in How to set up the FMOD audio library in Qt Creator for Android:

      Try the latest Qt6 if you prefer Qt6. Qt-6.2 is new in Qt 6.

      Sorry. I forgot to write what I use. I use: FMODE 2.02.16 API version, JDK 17, NDK 22, Qt 6.2.4, and Redmi 4x (Android 7)

      1 Reply Last reply
      0
      • J JoeCFD
        18 Aug 2023, 15:53

        @8Observer8 said in How to set up the FMOD audio library in Qt Creator for Android:

        ANDROID_EXTRA_LIBS

        I guess
        if your app is built with Qt6, use QT_ANDROID_EXTRA_LIBS.
        Use ANDROID_EXTRA_LIBS for Qt5

        How do I view the contents of an APK file?

        APK files are saved in a compressed .ZIP format and can be opened by any Zip decompression tool. Therefore, if you would like to explore the contents of an APK file, you can rename the file extension to ".zip" and open the file, or you can open the file directly through a Zip application's open dialog box.

        Open or list your apk file to make sure these libs are added in.

        Try the latest Qt6 if you prefer Qt6. Qt-6.2 is new in Qt 6.
        I would prefer to use Qt5 for this. Especially your Android version is so old.

        8 Offline
        8 Offline
        8Observer8
        wrote on 18 Aug 2023, 17:08 last edited by
        #13

        @JoeCFD said in How to set up the FMOD audio library in Qt Creator for Android:

        Open or list your apk file to make sure these libs are added in.

        Yes, libfmod.so is there. But How to make sure that the path is corrent?

        624f4307-5d49-4111-ba92-438ce6df3815-image.png

        J 1 Reply Last reply 18 Aug 2023, 17:29
        0
        • 8 8Observer8
          18 Aug 2023, 17:08

          @JoeCFD said in How to set up the FMOD audio library in Qt Creator for Android:

          Open or list your apk file to make sure these libs are added in.

          Yes, libfmod.so is there. But How to make sure that the path is corrent?

          624f4307-5d49-4111-ba92-438ce6df3815-image.png

          J Offline
          J Offline
          JoeCFD
          wrote on 18 Aug 2023, 17:29 last edited by
          #14

          @8Observer8 they are all together. No path issue here.

          8 2 Replies Last reply 18 Aug 2023, 17:41
          0
          • J JoeCFD
            18 Aug 2023, 17:29

            @8Observer8 they are all together. No path issue here.

            8 Offline
            8 Offline
            8Observer8
            wrote on 18 Aug 2023, 17:41 last edited by
            #15

            @JoeCFD please, try to run it

            J 1 Reply Last reply 18 Aug 2023, 18:13
            0
            • J JoeCFD
              18 Aug 2023, 17:29

              @8Observer8 they are all together. No path issue here.

              8 Offline
              8 Offline
              8Observer8
              wrote on 18 Aug 2023, 17:45 last edited by 8Observer8
              #16

              @JoeCFD said in How to set up the FMOD audio library in Qt Creator for Android:

              they are all together. No path issue here.

              I mean, maybe Qt try to find it on the wrong path that I wrote in pro-file. I found somewhere that the folder must be named jniLibs:

              contains(ANDROID_TARGET_ARCH, armeabi-v7a)
              {
                  ANDROID_EXTRA_LIBS += $$PWD/jniLibs/armeabi-v7a/libfmod.so
              }
              
              1 Reply Last reply
              0
              • 8 Offline
                8 Offline
                8Observer8
                wrote on 18 Aug 2023, 17:58 last edited by
                #17

                I tried to use lib instead of jniLibs but the result is the same.

                contains(ANDROID_TARGET_ARCH, armeabi-v7a)
                {
                    ANDROID_EXTRA_LIBS += $$PWD/lib/armeabi-v7a/libfmod.so
                }
                
                1 Reply Last reply
                0
                • 8 8Observer8
                  18 Aug 2023, 17:41

                  @JoeCFD please, try to run it

                  J Offline
                  J Offline
                  JoeCFD
                  wrote on 18 Aug 2023, 18:13 last edited by
                  #18

                  @8Observer8 Very few people have phones with Android 7.

                  8 1 Reply Last reply 18 Aug 2023, 18:58
                  0
                  • J JoeCFD
                    18 Aug 2023, 18:13

                    @8Observer8 Very few people have phones with Android 7.

                    8 Offline
                    8 Offline
                    8Observer8
                    wrote on 18 Aug 2023, 18:58 last edited by
                    #19

                    @JoeCFD said in How to set up the FMOD audio library in Qt Creator for Android:

                    Very few people have phones with Android 7.

                    I think the smaller the version, the more you can capture the audience. Let's say if you build for Android 4, then the application will run on Android 4, 5, 6, 7, 8, 9, 10, 11 and so on. But if you build on the latest version of Android, then the audience will be very small.

                    J 1 Reply Last reply 18 Aug 2023, 19:02
                    0
                    • 8 8Observer8
                      18 Aug 2023, 18:58

                      @JoeCFD said in How to set up the FMOD audio library in Qt Creator for Android:

                      Very few people have phones with Android 7.

                      I think the smaller the version, the more you can capture the audience. Let's say if you build for Android 4, then the application will run on Android 4, 5, 6, 7, 8, 9, 10, 11 and so on. But if you build on the latest version of Android, then the audience will be very small.

                      J Offline
                      J Offline
                      JoeCFD
                      wrote on 18 Aug 2023, 19:02 last edited by JoeCFD
                      #20

                      @8Observer8 then you need to add the support up to Android 13. Did you do it? Or you simply made Android 7 support?

                      my app supports Android 11, 12 and 13.

                      8 2 Replies Last reply 18 Aug 2023, 19:17
                      0
                      • J JoeCFD
                        18 Aug 2023, 19:02

                        @8Observer8 then you need to add the support up to Android 13. Did you do it? Or you simply made Android 7 support?

                        my app supports Android 11, 12 and 13.

                        8 Offline
                        8 Offline
                        8Observer8
                        wrote on 18 Aug 2023, 19:17 last edited by 8Observer8
                        #21

                        @JoeCFD said in How to set up the FMOD audio library in Qt Creator for Android:

                        my app supports Android 11, 12 and 13.

                        I think Android is backward compatible. That is, if I created applications with the selected Android 4, this means that the application will work not only on Android 4, but also on Android 5, 12 and 13.

                        J 1 Reply Last reply 18 Aug 2023, 20:05
                        0
                        • 8 8Observer8
                          18 Aug 2023, 19:17

                          @JoeCFD said in How to set up the FMOD audio library in Qt Creator for Android:

                          my app supports Android 11, 12 and 13.

                          I think Android is backward compatible. That is, if I created applications with the selected Android 4, this means that the application will work not only on Android 4, but also on Android 5, 12 and 13.

                          J Offline
                          J Offline
                          JoeCFD
                          wrote on 18 Aug 2023, 20:05 last edited by
                          #22

                          @8Observer8 I guess not. I built my app for Android 11 and 12 at first. And it did not work on Android 13. I had to add 13 support in the build.

                          8 2 Replies Last reply 18 Aug 2023, 20:46
                          0
                          • J JoeCFD
                            18 Aug 2023, 20:05

                            @8Observer8 I guess not. I built my app for Android 11 and 12 at first. And it did not work on Android 13. I had to add 13 support in the build.

                            8 Offline
                            8 Offline
                            8Observer8
                            wrote on 18 Aug 2023, 20:46 last edited by 8Observer8
                            #23

                            @JoeCFD I need to check it out. Later, I'm going to create a blank window for Qt for Android 7 and run it on Android 12. I can't believe the blank window won't work.

                            1 Reply Last reply
                            0
                            • J JoeCFD
                              18 Aug 2023, 20:05

                              @8Observer8 I guess not. I built my app for Android 11 and 12 at first. And it did not work on Android 13. I had to add 13 support in the build.

                              8 Offline
                              8 Offline
                              8Observer8
                              wrote on 18 Aug 2023, 20:56 last edited by
                              #24

                              @JoeCFD My only guess is that an app built for Android 11 doesn't work on Android 13 because it uses APIs that were removed in Android 13, but unless you're using backwards compatibility hacks, then early apps should work on more number of new devices. But this is only my assumption, which I myself have to verify by experience.

                              1 Reply Last reply
                              0
                              • 8 Offline
                                8 Offline
                                8Observer8
                                wrote on 30 Aug 2023, 15:48 last edited by 8Observer8
                                #25

                                I currently have an Android 13 smartphone. I tried to run my music application using OpenAL. It works on smartphones with Android 13 and 7. This is very good, because I thought that I would have to make a separate build in the APK for each version of the smartphone, starting from Android 7 to13.

                                J 1 Reply Last reply 30 Aug 2023, 15:54
                                0
                                • 8 8Observer8
                                  30 Aug 2023, 15:48

                                  I currently have an Android 13 smartphone. I tried to run my music application using OpenAL. It works on smartphones with Android 13 and 7. This is very good, because I thought that I would have to make a separate build in the APK for each version of the smartphone, starting from Android 7 to13.

                                  J Offline
                                  J Offline
                                  JoeCFD
                                  wrote on 30 Aug 2023, 15:54 last edited by JoeCFD
                                  #26

                                  @8Observer8 What I did is to add all SDKs of Android 11, 12 and 13 to the project, but I made only one build . My app works fine in 11, 12 and 13.

                                  8 1 Reply Last reply 30 Aug 2023, 17:44
                                  0
                                  • J JoeCFD
                                    30 Aug 2023, 15:54

                                    @8Observer8 What I did is to add all SDKs of Android 11, 12 and 13 to the project, but I made only one build . My app works fine in 11, 12 and 13.

                                    8 Offline
                                    8 Offline
                                    8Observer8
                                    wrote on 30 Aug 2023, 17:44 last edited by 8Observer8
                                    #27

                                    @JoeCFD said in How to set up the FMOD audio library in Qt Creator for Android:

                                    What I did is to add all SDKs of Android 11, 12 and 13 to the project

                                    Last time you wrote that if the application is built for Android 7 and Android 12 SDK, then it will not work on Android 13. Interestingly, I was unable to remove the Android 12 SDK from Qt Creator. Qt Creator says that Android 12 SDK is required:

                                    dc7a508d-767d-4212-bc93-f8b590a6e820-image.png

                                    I don't have the Android 13 SDK installed, but my app works fine on Android 13 and Android 7:

                                    ed42d8a1-9f57-445e-8812-eecbb2d5f239-image.png

                                    23a832d2-107b-4e5f-99bb-b516a4452efe-image.png

                                    15864b21-df2d-46d2-902c-2ca336c454fc-image.png

                                    f212cb91-a6f1-481e-b8c2-dcec0cd849cd-image.png

                                    J 1 Reply Last reply 30 Aug 2023, 23:42
                                    0
                                    • 8 Offline
                                      8 Offline
                                      8Observer8
                                      wrote on 30 Aug 2023, 18:05 last edited by
                                      #28

                                      My APK file that I asked to try running on Android 13 two weeks ago turned out to work on Android 7 and Android 13. I compiled OpenAL to work with audio for Android 10 (When building OpenAL, I used Android API 29, which is compatible with Android 10). The compiled library works on Android 7 and Android 13. I tested it on real devices. I have the Android 7 and Android 12 SDKs installed in Qt Creator in the SDK manager. Tried to run on Android 7 and Android: OpenAL, Box2D, Bullet Physics and OpenGL ES 2.0. That's all you need to develop 2D and 3D games. Now I'm not interested in wasting time on FMOD. You can read posts from one of the FMOD developers on the official FMOD forum: https://qa.fmod.com/t/qt-application-with-fmod-audio-library-crashes-on-launch-on-android/20561

                                      1 Reply Last reply
                                      0
                                      • 8 8Observer8
                                        30 Aug 2023, 17:44

                                        @JoeCFD said in How to set up the FMOD audio library in Qt Creator for Android:

                                        What I did is to add all SDKs of Android 11, 12 and 13 to the project

                                        Last time you wrote that if the application is built for Android 7 and Android 12 SDK, then it will not work on Android 13. Interestingly, I was unable to remove the Android 12 SDK from Qt Creator. Qt Creator says that Android 12 SDK is required:

                                        dc7a508d-767d-4212-bc93-f8b590a6e820-image.png

                                        I don't have the Android 13 SDK installed, but my app works fine on Android 13 and Android 7:

                                        ed42d8a1-9f57-445e-8812-eecbb2d5f239-image.png

                                        23a832d2-107b-4e5f-99bb-b516a4452efe-image.png

                                        15864b21-df2d-46d2-902c-2ca336c454fc-image.png

                                        f212cb91-a6f1-481e-b8c2-dcec0cd849cd-image.png

                                        J Offline
                                        J Offline
                                        JoeCFD
                                        wrote on 30 Aug 2023, 23:42 last edited by JoeCFD
                                        #29

                                        @8Observer8 It is the case of my app which has a lot of third-party libs. I had to add Android 13 SDK to make it run properly. But it is also true that 4 small libs I built with
                                        Android 12 can still be used in Android 13. I guess different apps may require different SDKs. I did not spend a lot of time on it and simply made my app running.

                                        1 Reply Last reply
                                        0
                                        • J JoeCFD
                                          18 Aug 2023, 19:02

                                          @8Observer8 then you need to add the support up to Android 13. Did you do it? Or you simply made Android 7 support?

                                          my app supports Android 11, 12 and 13.

                                          8 Offline
                                          8 Offline
                                          8Observer8
                                          wrote on 31 Aug 2023, 00:09 last edited by 8Observer8
                                          #30

                                          @JoeCFD said in How to set up the FMOD audio library in Qt Creator for Android:

                                          you need to add the support up to Android 13. Did you do it? Or you simply made Android 7 support?

                                          It's not possible to only support Android 7 as Qt Creator won't let you uninstall the Android 12 SDK. If you try to uninstall the Android 12 SDK, Qt Creator will issue a message and install the Android 12 SDK again. FMOD is built in such a way that it will work on Android 13 as well. My example was very simple. It included only FMOD. I understand you just didn't have the time or desire to run it. But I now have two smartphones with Android 7 and Android 13, and I can test my games on OpenGL ES, OpenAL, Box2D and Bullet Physics. I don't need many libraries. These are enough. Qt already includes support for working with JSON, web sockets, and so on. I like OpenAL a lot more than FMOD. I haven't figured out how to use FMOD, but I don't need to - I don't want to waste time on it. OpenAL-Soft is the best for 3D audio because it's easy to install, free and open source.

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved