DSPRelated.com
Forums

Windowing

Started by Unknown November 10, 2006
m.topczewski@gmail.com wrote:

> sound_buffer = (short *) malloc (sizeof(short) * > data_size/size_per_sample); > > This looks ok?
No ;) That will work *if* size_per_sample == sizeof(short) but is then unnecessarily circuitous. If you ultimately want your program to handle arbitrary frame widths or at least a range of common values, you will need to piece the samples together from the raw bytes with bitwise operations or else duplicate the affected code. Actually, I recommend you stop mucking about with that stuff and use libsndfile: http://www.mega-nerd.com/libsndfile/ Martin -- We don't often think of the lavish jeweled scarabs that decorated the mummies as representations of dung beetles who nourished their /pupae/ in excrement. We have, however, appropriated this term into English as /pupil/. -- B. Hagens, Timbre of the Spheres