KMP IOS AVAudioPlayer NPE
If you’re trying to play some sound on the IOS device using KMP, and face NPE while trying to instantiate the AVAudioPlayer instance, you may want to do it another way: The code will be as follows:
READ MOREsimply about difficult
If you’re trying to play some sound on the IOS device using KMP, and face NPE while trying to instantiate the AVAudioPlayer instance, you may want to do it another way: The code will be as follows:
READ MOREThis code is for converting audio in ByteArray in PCM int 16 bit mono format to audio in ABAudioPCMBuffer in PCM float 32 bit stereo format:
READ MOREHere we have the method that converts audio in AVAudioPCMBuffer in PCM float 32 bit mono format to audio in ByteArray in PCM int 16 bit mono format:
READ MOREIt’s possible to have multiple instance of AVAudioEngine in the same app, for example one for mic recording, one for playing a sound. But we can find out that without proper configuration it won’t work. The thing is that we should setup an audio session: Respective method will look like this: Audio play and record […]
READ MOREYou may have noticed that it’s hard to limit the size of the menu (ModelDrawer) in Kotlin Multiplatform, since there is just no such parameter. In this article we will find answers to these questions: The workaround here is to set the transparent color for the background, add new box with our own size limitations […]
READ MOREIn this article we will find out answers to these questions: Kotlin Multiplatform project may have these parts: Important note, that we should execute any Gradle tasks using Run Configurations in Android Studio. Edit Configurations -> Add new -> Gradle -> Paste Gradle task to “Tasks and arguments” field. You may face errors when trying […]
READ MOREWhen trying to build a WebSocket connection without SSL on Android we might encounter this guy: If it is a development environment and you want to test things, obtaining proper SSL certificate could take time. Therefore, possible solutions are: 1. Adjust app manifest and allow cleartext communications This is simpler option, so let’s start with […]
READ MOREWhen developing a Kotlin Multiplatform/Ktor application that uses WebSockets for Android (or for other platform!), we might run into this exception: TL;DR: okhttp is one of the engines that works both with Android and WebSockets. If you target other platform, look at the link from above. To be able to understand the root of the […]
READ MOREIn this article we will find answers to the following questions: Suppose we have the following navigation host: All we need to do is to set up value for enterTransition and exitTransition. If needed, you may want to look at popEnterTransition and popExitTransition as well. In this example we just turn off the transitions:
READ MOREUnfortunately, it seems that Kotlin Multiplatform doesn’t support setting minimum window size for the desktop right now, however, there is a workaround. In this article we will find an answer to the following questions: Suppose we have some window with size: So the idea is to add listener for size changes and adjust it given […]
READ MORE