return;
}
- if (_data) {
- free (_data);
- }
+ free (_data);
_capacity = size;
_size = size;
cache_aligned_malloc ((void**) &_data, sizeof (Sample) * _capacity);
}
-
+bool
+AudioBuffer::check_silence (pframes_t nframes, pframes_t& n) const
+{
+ for (n = 0; n < _size && n < nframes; ++n) {
+ if (_data[n] != Sample (0)) {
+ return false;
+ }
+ }
+ return true;
+}