Code Monkey home page Code Monkey logo

Comments (8)

michaeltyson avatar michaeltyson commented on July 18, 2024

Hey @soareschen - Thanks for the kind words! Would you mind grabbing the latest changes and trying again? I believe @rklaver has identified and resolved the issue in my absence!

from theamazingaudioengine.

soareschen avatar soareschen commented on July 18, 2024

Hi @michaeltyson,

I guess @rklaver's patch would solve the problem, provided that the preferred hardware rate is guaranteed to be configurable after the audio session is activated.

What I don't understand is the followed snippet when the hardware sample rate setting failed. Why change the asbd's sample rate to the current hardware sample rate? I believe core audio would run just fine despite the asbd's sample rate is different from the current hardware sample rate?

Soares

from theamazingaudioengine.

michaeltyson avatar michaeltyson commented on July 18, 2024

That's updated because AEAudioController's audioDescription needs to reflect the audio description that's currently in use - if the sample rate achieved isn't the one requested, it needs to be updated to reflect what's actually in use. Otherwise it runs the risk of introducing audio artefacts due to the incorrect sample rate.

from theamazingaudioengine.

michaeltyson avatar michaeltyson commented on July 18, 2024

Actually, that's not entirely true: I haven't tested this, but the mixer may automatically perform sample rate conversion. I'm not sure, though.

from theamazingaudioengine.

lijon avatar lijon commented on July 18, 2024

The remoteIO unit performs any conversion needed, including sample rate,
depending on the audio descriptions set for the app-side of the unit.

That is: The stream format set on the output scope of element 1 (audio in) decides
the format you get when pulling audio from the hardware input. And the stream format set on the input scope of element 0 (audio out) decides the format you should write to the buffers for hardware output.

So, all you need to do is to tell it what format you wish to work with in
your app, and you don't need to care about the actual hardware format
(including sample rate, number of channels, etc..)

I thought this was what AEAudioController's audioDescription was for? Or
where exactly is that used, for the input format or output format? And is
the inputAudioDescription matching the actual hardware format, or the
client side format set on the output scope of element 1?

In a similar matter, the multichannel mixer unit performs conversion if the
stream format of the inputs are different than the stream format of the
output.

from theamazingaudioengine.

michaeltyson avatar michaeltyson commented on July 18, 2024

I think this might be a misconception on my part: I thought the hardware sample rate dictates what sample rate the IO unit delivers. If it has sample rate conversion facilities, then I've taken the wrong approach when the delivered hardware sample rate isn't the same as the requested one!

from theamazingaudioengine.

michaeltyson avatar michaeltyson commented on July 18, 2024

Fixed with SHA 7bdb02a

from theamazingaudioengine.

soareschen avatar soareschen commented on July 18, 2024

Thanks for fixing the issue. Glad that we resolved the confusion and found the right way to configure the ASBD.

from theamazingaudioengine.

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.