Modules/std/audio/audiodata update

About Monkey 2 Forums Monkey 2 Code Library Modules/std/audio/audiodata update

This topic contains 3 replies, has 3 voices, and was last updated by  Mark Sibly 1 year, 8 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #10206


    Here’s a modified version of SetSample

    The original was unfinished and was just a place holder. Here is the completed version.

    You can test it by using getsample and feeding the result back with setsample



    You’ve got skill Adam! Keep it up!


    Mark Sibly

    Nice attempt but it’s not quite right – the Mono8 case at least is broken (haven’t looked at others) as it will convert 1.0 to 0 (should be 255). But this is a long overdue addition anyway so here’s my attempt:

    Note that GetSample will never actually quite return +1.0 (it will return .999 etc for max sample value). This reflects the fact that there are actually fewer sample values>0 than there are <0. Googling around suggests this is the best way to handle that. You can still SetSample 1.0 for max value no problems, it just wont read back as exactly that.


    Mark Sibly

    And here’s a little test app:

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.