I am doing a project on streaming audio over bluetooth..

Is there any way to record the audio directly to a buffer instead of a file in python..also is it possible to overwrite an already recorded file starting from its beginning(without deleting and recreating it)...