Hacker News new | ask | show | jobs
by Joeboy 160 days ago
> Is this not the job of the operating system or its supporting parts, to deal with audio from various sources

I think that's the point? In practice the OS (or its supporting parts) resample audio all the time. It's "under the hood" but the only way to actually avoid it would be to limit all audio files and playback systems to a single rate.

1 comments

I don't understand then, why they need to deal with that when making a game, unless they are not satisfied with the way that the OS resamples under the hood.
My reading is not that they're saying it's something they necessarily have deal with themselves, but that it's something they can't practically avoid.
But they CAN practically avoid it. lol. Just let the system do it for them.
If my audio files are 44.1kHz, and the user plays 48kHz audio at the same time, how do I practically avoid my audio being resampled?
You cannot avoid it either way then, I guess. Either you let the system do it for you, or you take matters into your own hands. But why do you feel it necessary to take matters into your own hands? I think that's the actual question that begs answering. Are you unsatisfied with how the system does the resampling? Does it result in a worse quality than your own implementation of resampling? Or is there another reason?
I don't feel it necessary to take matters into my own hands. If you read my original message again:

    > Either my game has to resample from 44.1kHz to 48kHz
    > before sending it to the system, or the system
    > sound mixer needs to resample it to 48kHz, or the
    > system sound mixer needs to resample the other software
    > from 48kHz to 44.1kHz
I expressed no preference with regard to those 3. I was outlining the theoretically possible options, to illustrate that there is no way to avoid resampling.
I suppose, if you interpret "avoid" as "not care about".
I interpret them to mean "avoid doing it oneself" not "avoid it happening entirely".
If you read the comments with the other interpretation I think the conversation will make more sense.