-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: playing audio source android (#219)
* feat: added libsndfile, rearrange external libs dir and added AudioDecoder * feat: added expo, expo document picker and expo files * refactor: refactored AudioFile example * refactor: added setting audio source from url * ci: yarn format * refactor: refactored AudioAPIInstaller and AudioAPiModule * feat: added expo to fabric app * ci: yarn format * fix: fixed AudioDecoder initialization * feat: added libsamplerate * refactor: removed unused archs * refactor: changed decoding lib to miniaudio and refactored AudioDecoder * refactor: refactored CMakeLists.txt * ci: yarn format * refactor: removed playing from url, name convention refactoring * chore: yarn lock * chore: test * ci: yarn format * ci: fix * ci: fix --------- Co-authored-by: Maciej Makowski <[email protected]>
- Loading branch information
1 parent
7fd138a
commit 81ecbe6
Showing
55 changed files
with
95,753 additions
and
708 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 26 additions & 18 deletions
44
apps/fabric-example/android/app/src/main/java/com/fabricexample/MainApplication.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,52 @@ | ||
package com.fabricexample | ||
|
||
import android.content.res.Configuration | ||
import expo.modules.ApplicationLifecycleDispatcher | ||
import expo.modules.ReactNativeHostWrapper | ||
import android.app.Application | ||
import com.facebook.react.PackageList | ||
import com.facebook.react.ReactApplication | ||
import com.facebook.react.ReactHost | ||
import com.facebook.react.ReactNativeHost | ||
import com.facebook.react.ReactPackage | ||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load | ||
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost | ||
import com.facebook.react.defaults.DefaultReactNativeHost | ||
import com.facebook.react.soloader.OpenSourceMergedSoMapping | ||
import com.facebook.soloader.SoLoader | ||
|
||
class MainApplication : Application(), ReactApplication { | ||
|
||
override val reactNativeHost: ReactNativeHost = | ||
object : DefaultReactNativeHost(this) { | ||
override fun getPackages(): List<ReactPackage> = | ||
PackageList(this).packages.apply { | ||
// Packages that cannot be autolinked yet can be added manually here, for example: | ||
// add(MyReactNativePackage()) | ||
} | ||
|
||
override fun getJSMainModuleName(): String = "index" | ||
|
||
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG | ||
ReactNativeHostWrapper(this, object : DefaultReactNativeHost(this) { | ||
override fun getPackages(): List<ReactPackage> { | ||
val packages = PackageList(this).packages | ||
// Packages that cannot be autolinked yet can be added manually here, for example: | ||
// packages.add(new MyReactNativePackage()); | ||
return packages | ||
} | ||
|
||
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED | ||
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED | ||
override fun getUseDeveloperSupport(): Boolean { | ||
return BuildConfig.DEBUG; | ||
} | ||
|
||
override fun getJSMainModuleName(): String = "index" | ||
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED | ||
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED | ||
}) | ||
|
||
override val reactHost: ReactHost | ||
get() = getDefaultReactHost(applicationContext, reactNativeHost) | ||
get() = ReactNativeHostWrapper.createReactHost(applicationContext, reactNativeHost) | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
SoLoader.init(this, OpenSourceMergedSoMapping) | ||
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { | ||
// If you opted-in for the New Architecture, we load the native entry point for this app. | ||
load() | ||
} | ||
load() | ||
|
||
ApplicationLifecycleDispatcher.onApplicationCreate(this) | ||
} | ||
|
||
override fun onConfigurationChanged(newConfig: Configuration) { | ||
super.onConfigurationChanged(newConfig) | ||
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.