Modules/std/audio/audiodata update

Home 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 2 months, 2 weeks ago.

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

    AdamStrange
    Participant

    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

    #10227

    scurty
    Participant

    You’ve got skill Adam! Keep it up!

    #10235

    Mark Sibly
    Keymaster

    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.

    #10236

    Mark Sibly
    Keymaster

    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.