I am new to using Alsa API for sound processing. I am trying to use Alsa API to receive an input, process and send it back to the outout port. I have set the buffer size of 512.
Source = alsaaudio.PCM(alsaaudio.PCM_CAPTURE, device = cards, channels = 2, rate = 48000,
format = alaaduio.PCM+FORMAT_S16_LE, periodsize = 64, period = 8)
The way, I am trying to process is to, read 64 samples, 8 times(Period = 8) and then once the buffer is full, I will stop the reading and process the received data before sending to the output port.
To achieve that, I either need to monitor the buffer or period.Is there a way to monitor the buffer when it reaches to its 512th bit or maybe the period when it reaches its 8th cycle?
The following command can give you information about the system.
Info1= source.info()
When I run this, it always shows the period as 0.
Anyone can suggest a solution or a way to help?
Using commends such as Info1= source.info() to get the info about the system peripherals but not getting what I need.