////////// // // Called to request that each stream populate itself // ////// void isound_requestStreams(SStartEndCallback* cb) { _isSSound* lss; // Make sure our environment is sane if (cb && cb->ptr) { // Grab our pointer lss = (_isSSound*)cb->ptr; // Is this item being processed? if (lss->isPlaying && lss->samples) { // What exactly are we processing? if (lss->isStream) { // Ask the stream to fill itself lss->stream.filler.callback(lss->samples, (u32)cb->extra, &lss->isPlaying); // TODO: Based on runtime observation, when the system is very active the sound is jittery. // We should add a double-buffer to request the one ahead of the one that will be played // that way we can immediately switch over to the previous 2nd buffer while we're filling // the request for the next one. A triple buffer might even be better. } else { // Generate the tone(s) iisound_generateTones(lss, (u32)cb->extra); } } } }
////////// // // Called to request that each stream populate itself // ////// void isound_requestStreams(SStartEndCallback* cb) { _isSSound* lss; // Make sure our environment is sane if (cb && cb->ptr) { // Grab our pointer lss = (_isSSound*)cb->ptr; // Is this item being processed? if (lss->isPlaying && lss->samples) { // What exactly are we processing? if (lss->isStream) { // Ask the stream to fill itself lss->stream.filler.callback(lss->samples, (u32)cb->extra, &lss->isPlaying); } else { // Generate the tone(s) iisound_generateTones(lss, (u32)cb->extra); } } } }