Re: $surface->pixel is slow + audio data chunks

[email protected] ("David J. Goehrig")
Newsgroups perl.sdl.devel
Message-ID <[email protected]>
Brian Cassidy wrote:
> The data format is very much like an ANSI file where there's a
> background color then a char on top of in another color. each
> character in an 8x8 block needs to be checked against the bit mask of
> the font to see if it writes a fg color to the screen or not.
>   
It may require modifications to the version of SDL_Perl that you're 
running but SDL::Surface->pixels can be made to return a string of 
binary image data.  You can then apply unpack on it, and run it through 
map, or a regular expression, etc.
> My other question is that I can't for the life of me figure out how to
> play the audio frame portion ($abuffer in the program) -- is it even
> possible to play raw audio from a variable with SDL_Perl?
>   
Yeah it is possible to play PCM data.  But it is platform dependent.  
Some threading issues occur on platform that run audio in a separate 
thread.  The audio callback code, however, can be a pain to work with in 
Perl, because of re-entrancy issues even on a suitable platform.  
Currently, the box I'm on doesn't like the audio code, and I haven't 
played with it in over a year.

Dave
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.