Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3440194
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:24:11+00:00 2026-05-18T08:24:11+00:00

In SDL, when you set up your audio output device, you and SDL have

  • 0

In SDL, when you set up your audio output device, you and SDL have to agree on an audio format – e.g. 44.1KHz stereo 16-bit signed little-endian. That’s fine. But along with the final agreed format, you also get a computed “silence” value which doesn’t seem well documented.

A silent sound sample obviously consist of the same sample value repeated over and over again, and you want that to be at the “zero” level. In a sense any constant value will do, but you have to agree a value (so you don’t get pops when switching to a different sound), and in a sane world you want to choose a value bang in the centre of your sample-value range.

So if you happen to use an unsigned format for your sample value range for 0..whatever, your silence value will be (whatever/2).

EDIT – inserted “unsigned” below to avoid confusion.

That’s all fine. But the silence value you get given is an unsigned 8-bit integer. That doesn’t work very well if you want unsigned 16 bit samples – the logical silence value of 0x8000 requires two different byte values and it requires them to be in the correct endian order.

So the silence value you get from SDL doesn’t seem to make much sense. You can’t use it to wipe your buffers, for instance, without dealing with extra complications and making inferences which pretty much make the precalculated silence value pointless anyway.

Which means, of course, that I’ve misunderstood the point.

So – if this isn’t how the silence value is meant to be used, how should it be used?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:24:12+00:00Added an answer on May 18, 2026 at 8:24 am

    I have no evidence to back this up but I think the assumption here is that “silence” could be interpreted as “silence for common soundcard formats”. Those being:

    1. Unsigned 8-bit integers
    2. Signed 16-bit integers
    3. Signed 32-bit integers (for 24-bit audio data)
    4. Normalized 32-bit floating point
    5. Normalized 64-bit floating point.

    In all the cases except for unsigned 8-bit, zero (0) is the “zero amplitude” value. So the returned unsigned 8-bit integer contains all the possible values of “zero amplitude” for these formats.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project in the works with OpenGL and SDL. Users have the
I'm trying to set up something in SDL [in C++] where I can draw
I need advice on keyboard event handling with SDL. I have a 1st person
I am working through the SDL tutorials over at http://lazyfoo.net/SDL_tutorials/index.php and I'm stuck on
I'm trying to create an SDL drawing canvas inside of a simple QT4 window,
I'm using the SDL library to try to create a rendering context in a
In my SDL program, I am using a map construct to simulate an infinite
Reading misc. tutorials related to SDL development I've found two different examples, doing the
I've created this basic 3D Demo using OpenGL/SDL. I handled the keyboard callback so
I eventually couldn't get any further with my program due to the various shortcomings

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.