|Subject:||Re: [Discuss-gnuradio] WavFile_Sink Issues: slowed down sound - multiplied playing time|
|Date:||Sat, 31 Aug 2013 10:18:24 -0400|
I think I may have figured it out. It has to do with how the signal processing block that goes around the vocoder was written. The general_work function for gr_block classes takes in a requested number of outputs and also returns back how many output items were produced. The way it was written was that it would also report back the desired number of outputs were produced even if they were not. This worked fine for the audio_sink. I had no issues like to the audio through my sound card / sound server. However with the wav file recorder, it lead to the slowed down sounds and the actual playing time of the wav file being many times longer than it should have been.
When I switched the number of outputted items return by general_work to be the actual number of samples the were processed and ready to be outputted, the wav file sink started to work. The audio quality of the recorded wav file is still a little worse than the sound from sound quality. I think the reason this works is because the audio sink is "clocked" by the sound card and it only requests more samples once the buffer for the sound card is empty. On the other hand, I don't think the wav file sink is really rate limited, it seems to request more samples from the vocoder at a much higher rate. When the block lies and just keeps giving it empty samples whenever the wav file sink asks, the play time gets inflated and the actual audio bits get watered down with these fake samples. However, the weird thing is that the audio from the sound card now sounds weird when the vocoder only gives out samples when there is actual data. I think, this is because when there is actual data coming in there should be some empty blocks in between to reconstitute things.
Is this just crazy talk or does it sound right?
Here is the wav file were it is using only the actual samples produced and it is intelligible:
And here is the wav file where the vocoder block always returns the requested number of samples even if nothing was output:
My GRC file and the DSD block is here:
If you change /lib/dsd_block_ff.cc on line 365 & 366 you can change how the number of outputted samples is determined.
I have the C++ program the uses this all here:
https://github.com/robotastic/sdr under the smartnet directory
On Aug 30, 2013, at 8:53 PM, Andrew Davis <address@hidden> wrote:
|[Prev in Thread]||Current Thread||[Next in Thread]|