Replies: 2 comments
-
If you are attempting to read and decode the entire stream, iterating over container.decode(audioStream) is the way to do it. However, is there a technical reason you must load the entire decoded audio stream into memory at once? |
Beta Was this translation helpful? Give feedback.
-
I want to perform alignment (both shifting & scaling) of the audio stream with another time series based on cross-correlation. I think reading all data is the best way to do so, yes. The reason for my question is that each frame only contains 512 samples (at 48kHZ approx. 11 ms), and the whole stream is 43 min long. I feel like having larger chunks of data may be better. But as far as I can tell, there is no way to change that, or to read several frames at once? The other part is whether collecting subarrays in a list and then using |
Beta Was this translation helpful? Give feedback.
-
I'm trying to read a complete audio stream from a video file into a numpy array:
Is this the correct way, or is it possible to do it in a more efficient way?
I thought about preallocating the numpy array, but
audioStream.frames
is 0 andaudioStream.frames
isNone
.Beta Was this translation helpful? Give feedback.
All reactions