c++ - Buffering wave files / sample management -
in short: buffer whole sound file (wave) in heap. basically, utilize 1 arrays each channel, containing max 10 min * 60 sec * 44100
samples. (i limit length 10min , converting 44100 samples/sec if necessary.)
so have utilize 2 arrays length of 26460000
elements @ max. regarding size, arrays contain 16bit integers, adding ~100mbyte per file. (the applications should allowed open 4 files @ once, memory used add together ~400mbytes)
the question is, if work on windows (32bit) scheme or if should utilize more dynamic sample management instead? guess help cutting buffer int chunks of (for example) 1024 samples, wouldn't have utilize huge array bunch of smaller arrays.
if wouldn't idea, how implement sample management handle sudden jumps specific position in file or repeating samples. (so "simple" circle buffer overwrites old / used samples wouldn't help really...)
no big deal on win32. utilize std::vector::reserve
, know front end how many samples there are.
c++ arrays audio buffer
No comments:
Post a Comment