oboe | build high-performance audio apps

 by   google C++ Version: 1.7.0 License: Apache-2.0

kandi X-RAY | oboe Summary

kandi X-RAY | oboe Summary

oboe is a C++ library. oboe has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Oboe is a C++ library which makes it easy to build high-performance audio apps on Android. It was created primarily to allow developers to target a simplified API that works across multiple API levels back to API level 16 (Jelly Bean).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              oboe has a medium active ecosystem.
              It has 3375 star(s) with 527 fork(s). There are 137 watchers for this library.
              There were 1 major release(s) in the last 12 months.
              There are 141 open issues and 891 have been closed. On average issues are closed in 83 days. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of oboe is 1.7.0

            kandi-Quality Quality

              oboe has 0 bugs and 0 code smells.

            kandi-Security Security

              oboe has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              oboe code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              oboe is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              oboe releases are available to install and integrate.
              It has 30962 lines of code, 1175 functions and 447 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of oboe
            Get all kandi verified functions for this library.

            oboe Key Features

            No Key Features are available at this moment for oboe.

            oboe Examples and Code Snippets

            No Code Snippets are available at this moment for oboe.

            Community Discussions

            QUESTION

            How can I call function with PointerByReference arguments for a Float[]?
            Asked 2021-Oct-21 at 15:21

            I have a library that uses some c++ compiled code and I would like to use this and other functions to try it out but they all use Pointer and PointerByReference as arguments instead of normal types.

            ...

            ANSWER

            Answered 2021-Oct-21 at 15:21

            Since you don't include more of the API for a specific call I can't directly answer your implementation question, but I will address the portion of the question that asks about the types.

            In C (and C++), arrays are stored in contiguous native memory. If you know the type (float in this case) you can simply offset from the pointer to get the appropriate element, e.g., foo[0] is at the pointer location to the array, foo[1] would be at that pointer location plus an offset equal to the type byte size (4 bytes for a float) and so on.

            The Pointer and PointerByReference are JNA types. PointerByReference is a pointer that points to a Pointer; you can call the getValue() function on the PointerByReference() to retrieve this pointer.

            Based on the way I read this API, that Pointer is actually the beginning of the float array, so you'd just use that Pointer and retrieve the array from its location.

            So this is likely what you need to do:

            Source https://stackoverflow.com/questions/69655516

            QUESTION

            Execution failed for task ':app:externalNativeBuildDebug' when using cpp and java in android
            Asked 2021-Jun-18 at 00:17

            My android studio project is failing to build with this error when linking c++ to java using jni

            ...

            ANSWER

            Answered 2021-Jun-18 at 00:17

            Probably, you need to define actual variable separately in .cpp file for the static class-member, SoundGenerator::_Frequency, as follows.

            SoundGenerator.cpp

            Source https://stackoverflow.com/questions/68026152

            QUESTION

            Oboe Systrace are non full buffers considered as underruns or not?
            Asked 2021-Jun-05 at 06:14

            I am using oboe library to make a music app. There I produce music by writing PCM float values to the given pointer. I rarely have underruns which I can hearwhich. I also verify this with the following oboe APIs:

            ...

            ANSWER

            Answered 2021-Apr-14 at 23:08

            I dived deep and found out that

            managedStream->getXRunCount();

            Returns the number of XRuns for the streams whole lifetime. I thought it would return the value relative to previous call. So apparently I was getting 12 but there were no underrun because this was from the session which had previous underrun.

            However, I would love to see an explanation of what does it mean to have a non-full buffer in the trace.

            Source https://stackoverflow.com/questions/67010109

            QUESTION

            What is the best approach to stream JSON from a REST API to an Express app?
            Asked 2021-May-27 at 05:17

            I have a moleculer-based microservice that has an endpoint which outputs a large JSON object (around tens of thousands of objects)

            This is a structured JSON object and I know beforehand what it is going to look like.

            ...

            ANSWER

            Answered 2021-May-15 at 05:57

            Are you asking for a general approach recommendation, or for support with the particular solution you have?

            If it's for the first, then I think your best bet for communicating between the server and the client is through websockets, perhaps with something like Socket.io. A long lived connection will serve you well here, since it will take a long time to transmit all your data across.

            Then you can send data from the server to the client any time you like. At that point you can read your data on the server as a node.js stream and emit the data one at a time.

            The problem with using Oboe and writing to the response on every node is that it requires a long running response, and there's a high likelihood the connection could get interrupted before you've sent all the data across.

            Source https://stackoverflow.com/questions/67528026

            QUESTION

            How do I avoid loops in R?
            Asked 2021-May-21 at 20:09

            I understand that in R it is best to avoid loops where possible. In that regard, I would like to perform the function of the code below but without using the nested loops.

            The loops check whether the f'th element of the vector things_I_want_to_find is present in the i'th row of thing_to_be_searched. For example, when both i and f are 1, the code checks whether "vocals" is present in john's row. Because "vocals" is present in john's row, the name and instrument are added to vectors instrument and name. When both loops are complete these two vectors can be combined in a data.frame.

            I know that there is the apply() family of functions in R but I don't know if they are able to be used in this case. Has anyone got any helpful hints or suggestions?

            ...

            ANSWER

            Answered 2021-May-21 at 13:00
            library(tidyverse)
            thing_to_be_searched %>%
              # Melt wide data to long
              pivot_longer(-1) %>%
              # Drop unwanted column
              select(-name) %>%
              # Filter wanted values only
              filter( value %in% things_I_want_to_find) %>%
              # Only keep unique rows
              unique()
            

            Source https://stackoverflow.com/questions/67637297

            QUESTION

            Oboe stops rendering audio if there is too many data to be rendered
            Asked 2021-May-06 at 10:52

            I'm trying to implement Oboe library into my application, so I can perform low latency audio playing. I could perform panning, playback manipulation, sound scaling, etc. I've been asking few questions about this topic because I'm completely new to audio worlds.

            Now I can perform basic things which internal Android audio class such as SoundPool provides. I can play multiple sounds simultaneously without noticeable delays.

            But now I encountered another problem. So I made very simple application for example; There is button in screen and if user taps this screen, it plays simple piano sound. However fast user taps this button, it must be able to mix those same piano sounds just like what SoundPool does.

            My codes can do this very well, until I taps button too much times, so there are many audio queues to be mixed.

            ...

            ANSWER

            Answered 2021-May-06 at 10:52

            Does Oboe stop rendering audio if it takes too much time to render audio like situation above?

            Yes. If you block onAudioReady for longer than the time represented by numFrames you will get an audio glitch. I bet if you ran systrace.py --time=5 -o trace.html -a your.app.packagename audio sched freq you'd see that you're spending too much time inside that method.

            Did I reach limit of rendering audio, meaning that only limiting number of queues is the solution? or are there any ways to reach better performance?

            Looks like it. The problem is you're trying to do too much work inside the audio callback. Things I'd try immediately:

            • Different compiler optimisation: try -O2, -O3 and -Ofast
            • Profile the code inside the callback - identify where you're spending most time.
            • It looks like you're making a lot of calls to sin and cos. There may be faster versions of these functions.

            I spoke about some of these debugging/optimisation techniques in this talk

            One other quick tip. Try to avoid raw pointers unless you really have no choice. For example AudioStream* stream; would be better as std::shared_ptr and std::vector* players; can be refactored to std::vector players;

            Source https://stackoverflow.com/questions/67415335

            QUESTION

            How to handle speaker change with Android Oboe library?
            Asked 2021-Apr-17 at 16:14

            I'm trying to implement Oboe library to my project to perform the least latency when playing sounds. I could perform playback manipulating, panning, mixing, the basics things which internal Android library such as SoundPool can provide.

            I wanted to test panning effect, I connected headphones to my device, but then, I noticed that any sound didn't play through my headphones. Device speaker also didn't play any sound either. So I disconnected my headphones to check if something went wrong. I pressed sound playing button, but I couldn't hear any sound even though headphones are completely disconnected from device.

            When I firstly open the app, it can play sound through device speaker without any problems, but as soon as I connect headphones, no sound plays through both device speaker and headphones.

            Same for opposite, if I start app with headphones connected to device, it can play sound very well through headphones. It can even perform panning effect too, but if I disconnect headphones from device, it stops playing any sound.

            1. Do I have to re-open audio stream whenever preferred audio device is changed?
            2. If yes for 1, is there any way to notify app that audio device is changed, so I can manually close stream and re-open it? Or can I make Oboe automatically handle audio device changes?
            ...

            ANSWER

            Answered 2021-Apr-17 at 16:14

            You need to open a new audio stream when primary audio device changes as stated here in oboe full guide. Oboe will handle the detection of device change for you automatically if you configure it.

            Disconnected audio stream An audio stream can become disconnected at any time if one of these events happens:

            The associated audio device is no longer connected (for example when headphones are unplugged). An error occurs internally. An audio device is no longer the primary audio device. - When a stream is disconnected, it has the state "Disconnected" and calls to write() or other functions will return Result::ErrorDisconnected. When a stream is disconnected, all you can do is close it.

            Here is an example

            Source https://stackoverflow.com/questions/67092859

            QUESTION

            How to pan audio sample data naturally?
            Asked 2021-Apr-13 at 20:10

            I'm developing Flutter plugin which is targeting only Android for now. It's kind of synthesis thing; Users can load audio file into memory, and they can adjust pitch (not pitch shift) and play multiple sound with the least delay using audio library called Oboe.

            I managed to get PCM data from audio files which MediaCodec class supports, and also succeeded to handle pitch by manipulating playback via accessing PCM array manually too.

            This PCM array is stored as float array, ranging from -1.0 to 1.0. I now want to support panning feature, just like what internal Android class such as SoundPool. I'm planning to follow how SoundPool is handling panning. There are 2 values I have to pass to SoundPool when performing panning effect : left, and right. These 2 values are float, and must range from 0.0 to 1.0.

            For example, if I pass (1.0F, 0.0F), then users can hear sound only by left ear. (1.0F, 1.0F) will be normal (center). Panning wasn't problem... until I encountered handling stereo sounds. I know what to do to perform panning with stereo PCM data, but I don't know how to perform natural panning.

            If I try to shift all sound to left side, then right channel of sound must be played in left side. In opposite, if I try to shift all sound to right side, then left channel of sound must be played in right side. I also noticed that there is thing called Panning Rule, which means that sound must be a little bit louder when it's shifted to side (about +3dB). I tried to find a way to perform natural panning effect, but I really couldn't find algorithm or reference of it.

            Below is structure of float stereo PCM array, I actually didn't modify array when decoding audio files, so it should be common structure

            ...

            ANSWER

            Answered 2021-Apr-13 at 08:37

            Pan rules or pan laws are implemented a bit different from manufacturer to manufacturer.

            One implementation that is frequently used is that when sounds are panned fully to one side, that side is played at full volume, where as the other side is attenuated fully. if the sound is played at center, both sides are attenuated by roughly 3 decibels.

            to do this you can multiply the sound source by the calculated amplitude. e.g. (untested pseudo code)

            Source https://stackoverflow.com/questions/67062207

            QUESTION

            How to add protobuf into flutter/kotlin android project
            Asked 2021-Jan-14 at 16:36

            I'm trying to add protobuf to my flutter project. Here's the tree ls flutter_project:

            ...

            ANSWER

            Answered 2021-Jan-05 at 19:08

            First of I don't see your configuration for the protobuf compiler, if it is not set it will search for it in the system path (Is it available ?). Usually to avoid issues I'm using the distributed version of the compiler by configuring the protobuf configuration in the app gradle build file. Also i'm using the lite runtime as it is the recommended way for Android.

            Source https://stackoverflow.com/questions/65514600

            QUESTION

            Understanding std::apply inside std::visit
            Asked 2021-Jan-03 at 00:20

            ANSWER

            Answered 2021-Jan-02 at 22:23

            what is the second argument ...?

            (foo(args), ...) is a fold expression, using comma operator, equivalent to (foo(arg0), foo(arg1), .., foo(argn))

            What does args.template mean?

            template is used to disambiguate meaning of < for dependent type:

            without that, it would be parsed as

            (args.buildDefaultEffect < decltype(stack.getType())) > ().

            see where-and-why-do-i-have-to-put-the-template-and-typename-keywords.

            Source https://stackoverflow.com/questions/65544630

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install oboe

            You can download it from GitHub.

            Support

            Getting Started GuideFull Guide to OboeAPI referenceTech NotesHistory of Audio features/bugs by Android versionMigration guide for apps using OpenSL ESFrequently Asked Questions (FAQ)Our roadmap - Vote on a feature/issue by adding a thumbs up to the first comment.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/google/oboe.git

          • CLI

            gh repo clone google/oboe

          • sshUrl

            git@github.com:google/oboe.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link