Click here to Skip to main content
15,798,278 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Strolling off the edge Pin
honey the codewitch5-Apr-23 16:03
mvahoney the codewitch5-Apr-23 16:03 
GeneralRe: Strolling off the edge Pin
jschell6-Apr-23 6:14
jschell6-Apr-23 6:14 
GeneralRe: Strolling off the edge Pin
honey the codewitch6-Apr-23 11:04
mvahoney the codewitch6-Apr-23 11:04 
GeneralRe: Strolling off the edge Pin
jschell7-Apr-23 10:10
jschell7-Apr-23 10:10 
GeneralRe: Strolling off the edge Pin
jmaida5-Apr-23 11:32
jmaida5-Apr-23 11:32 
GeneralRe: Strolling off the edge Pin
honey the codewitch5-Apr-23 11:37
mvahoney the codewitch5-Apr-23 11:37 
JokeRe: Strolling off the edge Pin
FreedMalloc5-Apr-23 11:57
mveFreedMalloc5-Apr-23 11:57 
GeneralRe: Strolling off the edge Pin
honey the codewitch5-Apr-23 12:09
mvahoney the codewitch5-Apr-23 12:09 
Specifically

C++
static void wav_voice_16_1_to_16_2(const voice_func_info_t& info, void*state) {
    wav_info_t* wi = (wav_info_t*)state;
    if(!wi->loop&&wi->pos>=wi->length) {
        return;
    }
    uint16_t* dst = (uint16_t*)info.buffer;
    for(int i = 0;i<info.frame_count;++i) {
        int16_t i16;
        if(wi->pos>=wi->length) {
            if(!wi->loop) {
                break;
            }
            wi->on_seek_stream(wi->start,wi->on_seek_stream_state);
            wi->pos = 0;
        }
        if(player_read16s(wi->on_read_stream,wi->on_read_stream_state,&i16)) {
            wi->pos+=2;
        } else {
            break;
        }
        uint16_t u16 = (uint16_t)((i16+32768U)*wi->amplitude);
        for(int j=0;j<info.channels;++j) {
            *dst+=u16;
            ++dst;
            // YIKES! I lost track of the loop i was in and tried
            // writing out both channels here. removing these
            // two lines fixes it:
            *dst+=u16;
            ++dst;

        }
    }
}

To err is human. Fortune favors the monsters.

GeneralRe: Strolling off the edge Pin
Kenneth Haugland5-Apr-23 12:24
professionalKenneth Haugland5-Apr-23 12:24 
GeneralRe: Strolling off the edge Pin
jmaida5-Apr-23 16:26
jmaida5-Apr-23 16:26 
GeneralRe: Strolling off the edge Pin
honey the codewitch5-Apr-23 16:34
mvahoney the codewitch5-Apr-23 16:34 
GeneralRe: Strolling off the edge Pin
jmaida5-Apr-23 17:04
jmaida5-Apr-23 17:04 
GeneralRe: Strolling off the edge Pin
den2k885-Apr-23 22:42
professionalden2k885-Apr-23 22:42 
GeneralRe: Strolling off the edge Pin
jmaida6-Apr-23 7:42
jmaida6-Apr-23 7:42 
GeneralRe: Strolling off the edge Pin
BernardIE53176-Apr-23 4:09
BernardIE53176-Apr-23 4:09 
GeneralRe: Strolling off the edge Pin
honey the codewitch6-Apr-23 11:09
mvahoney the codewitch6-Apr-23 11:09 
GeneralRe: Strolling off the edge Pin
BernardIE53176-Apr-23 12:45
BernardIE53176-Apr-23 12:45 
GeneralRe: Strolling off the edge Pin
jeron16-Apr-23 13:25
jeron16-Apr-23 13:25 
GeneralRe: Strolling off the edge Pin
jschell7-Apr-23 10:35
jschell7-Apr-23 10:35 
GeneralRe: Strolling off the edge Pin
jschell7-Apr-23 10:34
jschell7-Apr-23 10:34 
GeneralRe: Strolling off the edge Pin
BernardIE53177-Apr-23 12:01
BernardIE53177-Apr-23 12:01 
GeneralRe: Strolling off the edge Pin
240DL6-Apr-23 5:23
240DL6-Apr-23 5:23 
GeneralRe: Strolling off the edge Pin
honey the codewitch6-Apr-23 11:05
mvahoney the codewitch6-Apr-23 11:05 
GeneralRe: Strolling off the edge Pin
englebart7-Apr-23 14:44
professionalenglebart7-Apr-23 14:44 
GeneralPython problems... Pin
glennPattonWork35-Apr-23 1:16
professionalglennPattonWork35-Apr-23 1:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.