Giter Site home page Giter Site logo

Comments (6)

svenoaks avatar svenoaks commented on June 12, 2024

I also have these exact errors. Any update on how to fix this?

from sfbaudioengine.

sbooth avatar sbooth commented on June 12, 2024

sbooth/AudioXCFrameworks#25 will fix the illegal bundle characters error.

from sfbaudioengine.

sbooth avatar sbooth commented on June 12, 2024

I've been experimenting with different ways to package SFBAudioEngine to make it simpler to build and include in other projects.

Initially I'd hoped the dependencies could be included as binary Swift package targets, but SPM doesn't handle dependencies for binary targets so getting, for example, the vorbis and flac frameworks to both depend on the ogg framework isn't realistically feasible. I think there are some gymnastics that can be done by making the binary target depend on an empty source target that then includes the binary sub dependency, but I don't really want to go down that road.

iOS doesn't permit umbrella frameworks so the current build strategy isn't viable.

To avoid building SFBAudioEngine as an umbrella framework the app using it will have to include the framework dependencies. Statically linking the code into a single SFBAudioEngine binary isn't an option because of LGPL requirements.

There are two options I've been contemplating for the dependencies:

  1. Include the compiled XCFramework dependencies in the repo
  2. Make the compiled XCFrameworks available as an external download

I'm leaning toward option 1 for simplicity.

from sfbaudioengine.

andykent avatar andykent commented on June 12, 2024

I'm not sure if this helps but we currently use your ogg/opus frameworks in an internal package that is built cross platform. Our current approach isn't ideal but it is working for our limited deps. If the compiled frameworks were in the repo then this would help make things simpler.

Once built we copy the compiled frameworks into a Frameworks folder in the root of the Swift package and then use the following Package config...

...
targets: [
  .target(
    name: "MyPackage",
    dependencies: ["COpusFile"]),
  .target(
    name: "COpusFile",
    dependencies: ["ogg", "opus"],
    path: "Sources/COpusFile"),
  .binaryTarget(
    name: "ogg",
    path: "Frameworks/ogg.xcframework"
  ),
  .binaryTarget(
    name: "opus",
    path: "Frameworks/opus.xcframework"
  )
]
...

where COpusFile just includes the following dummy swift bridge.

#include <ogg/ogg.h>
#include <opus/opusfile.h>
#include "bridge.h"

void __dummy() {}

We are then able to add the package as a project dep in Xcode and import COpusFile in Swift land and everything seems to just work. No idea if this is the right approach or not, it was mostly trial and error to get this point but it does upload to TestFlight at least.

from sfbaudioengine.

sbooth avatar sbooth commented on June 12, 2024

@andykent thanks for that. Out of curiosity if you add vorbis or flac (which also have dependencies on ogg) to your package do you get warnings about duplicated targets?

Right now I am leaning toward the following approach:

  1. Remove the XCFrameworks submodule and replace it with a directory
  2. Check in compressed versions of the .xcframework files in the XCFrameworks directory
  3. Create a target to decompress the xcframework archives as needed (using make most likely)
  4. Update the examples to link the frameworks

I think this will go a long way toward improving the usability of SFBAudioEngine for developers.

from sfbaudioengine.

sbooth avatar sbooth commented on June 12, 2024

This should be fixed in #230. Any testing to verify the new build process would be appreciated.

from sfbaudioengine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.