Detecting the last frame

View: New views
3 Messages — Rating Filter:   Alert me  

Detecting the last frame

by Troy Watson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

Is there a method to detect if the frame sent to mad_synth_frame is
the last frame in the stream, without knowing in advance how many
frames the input stream has?  I am using libsamplerate and it requires
the last block of audio data for a stream to set an end_of_input flag.
Checking the EOF indicator for the input file is insufficient as that
only informs me when the file has been fully buffered, not when the
last frame has been synthesized. Any ideas or suggestions?


Re: Detecting the last frame

by Rob Leslie :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sep 27, 2009, at 12:43 AM, Troy Watson wrote:
> Is there a method to detect if the frame sent to mad_synth_frame is  
> the last frame in the stream, without knowing in advance how many  
> frames the input stream has?  I am using libsamplerate and it  
> requires the last block of audio data for a stream to set an  
> end_of_input flag. Checking the EOF indicator for the input file is  
> insufficient as that only informs me when the file has been fully  
> buffered, not when the last frame has been synthesized. Any ideas or  
> suggestions?

You may need to decode the next frame before you output the previously  
synth'ed one to be absolutely sure.

Keep in mind that when mad_frame_decode() (or mad_header_decode())  
returns -1 and stream->error is MAD_ERROR_BUFLEN, and you are at EOF,  
there may be one last frame you can decode by appending  
MAD_BUFFER_GUARD zero bytes at the end of the buffer, but not  
necessarily.

--
Rob Leslie
rob@...



Libid3tag dependency on Zlib

by Kiran Biswal :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Libid3tag library needs zlib for compilation. In my source tree zlib source is in let's say /zlib folder and the makefile looks as attached. There are potentially other applications using zlib so I can't configur the zlib makefile specifically for libid3tag

I know that by installing zlib to a particular directory and pointing libid3tag to that path I could get away with this. But I am not allowed to edit the makefile.

Could you suggets a way how libid3tag can use this zlib?

Regards
Kiran

Makefile (1K) Download Attachment