Giter Site home page Giter Site logo

Comments (2)

garyscavone avatar garyscavone commented on June 3, 2024

The convertBuffer() function is general to the various data types and should not be modified to address a problem with a specific API. The Int24 data type is a class (defined in RtAudio.h) that support 24-bit data and provides functions to convert to other different types.

But if there is a problem with the support for ALSA 24-bit data, it should be fixed in the ALSA API section of the RtAudio code. That could potentially involve not using the Int24 data type at all and instead just calling the convertBuffer() function for 32-bit data. I won’t have time to look into this for a while.

On Aug 22, 2016, at 6:44 AM, knell [email protected] wrote:

For 24 bit sample format ALSA uses full 32 bit word and takes only 24 bits of data. In the convertBuffer() you use S24 pointer to iterate buffer and it's wrong for ALSA. For example, lines 9827-9838, there is:
Int24 *in = (Int24 *)inBuffer;
for ALSA you will take only three bytes from input buffer but you should take 4, like this:
Int32 *in = (Int32 *)inBuffer;
and later convert a value to Int24 to extract an integer.
The same in the line 9943, there is:
Int24 *out = (Int24 *)outBuffer;
so you will write 3 bytes of output but for ALSA it should be four. Now it writes only 3/4 of the buffer and the last 1/4 remains untouched. Actually it would be good to memset a buffer with 0 after calloc().

Also, there is no support of big endian formats (in S24 for example) but it should be like 'feature request', not a bug.

β€”
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub #74, or mute the thread https://github.com/notifications/unsubscribe-auth/AFOBpaF5zgN-Zui5lyHcDACnY7JePmV2ks5qiX2agaJpZM4JpvA9.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/thestk/rtaudio","title":"thestk/rtaudio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/thestk/rtaudio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"convertBuffer() is wrong for S24 and ALSA (#74)"}],"action":{"name":"View Issue","url":"https://github.com/thestk/rtaudio/issues/74"}}}

from rtaudio.

garyscavone avatar garyscavone commented on June 3, 2024

No follow-up ... assuming it was not a bug.

from rtaudio.

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.