search for: total_sample

Displaying 20 results from an estimated 64 matches for "total_sample".

Did you mean: total_samples
2004 Sep 10
3
[st.n@gmx.net: Bug#200435: xmms-flac: doesn't properly support long files]
...37,7 @@ > file_info->bits_per_sample = metadata->data.stream_info.bits_per_sample; > file_info->channels = metadata->data.stream_info.channels; > file_info->sample_rate = metadata->data.stream_info.sample_rate; > - file_info->length_in_msec = file_info->total_samples * 10 / (file_info->sample_rate / 100); > + file_info->length_in_msec = (FLAC__uint64)file_info->total_samples * 10 / (file_info->sample_rate / 100); > } > else if(metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) { > double gain, peak; It seems like would be...
2004 Sep 10
2
better seeking
...bound, lower_bound_sample, upper_bound_sample; + FLAC__int64 pos, last_pos = -1; + int i; unsigned approx_bytes_per_frame; - FLAC__uint64 last_frame_sample = 0xffffffffffffffff; + FLAC__uint64 last_frame_sample = 0xffffffffffffffff, this_frame_sample; FLAC__bool needs_seek; const FLAC__uint64 total_samples = decoder->private_->stream_info.total_samples; const unsigned min_blocksize = decoder->private_->stream_info.min_blocksize; @@ -862,12 +862,14 @@ * the first and last frames. */ lower_bound = first_frame_offset; + lower_bound_sample = 0; /* calc the upper_bound, beyond w...
2006 Nov 11
2
total_samples of Ogg Flac file
Hi all, I am able to create file containing Flac data encapsulated in an Ogg container. However, when I read the file and its metadata, the total_samples field contains the value zero, even though the file actually does contain samples and the stream does have an end of stream marker. I think something is going wrong when I'm encoding the file. Anybody have any idea of what I have forgotten to do during encoding? Cheers, Erik -- +----------...
2014 Aug 14
1
Encoder example for 24-bit files
...qcl.mail at gmail.com> wrote: > Jose Pablo Carballo <jose.carballo at ridgerun.com> wrote: > >> - channels = 2; >> - bps = 16; >> + channels = ((unsigned)buffer[23] << 8) | buffer[22]; >> + bps = ((unsigned)buffer[35] << 8) | buffer[34]; >> total_samples = (((((((unsigned)buffer[43] << 8) | buffer[42]) << 8) >> | buffer[41]) << 8) | buffer[40]) / 4; >> > > I suspect that the expression for total_samples should be not > > (.....) / 4 > > but > > (.....) / (channels * bps/8) Yes, that's corr...
2005 Jan 25
0
bitbuffer optimizations
...e, upper_bound_sample; + FLAC__int64 pos, last_pos = -1; + int i; unsigned approx_bytes_per_frame; - FLAC__uint64 last_frame_sample = FLAC__U64L(0xffffffffffffffff); + FLAC__uint64 last_frame_sample = FLAC__U64L(0xffffffffffffffff), this_frame_sample; FLAC__bool needs_seek; const FLAC__uint64 total_samples = decoder->private_->stream_info.total_samples; const unsigned min_blocksize = decoder->private_->stream_info.min_blocksize; @@ -903,12 +903,14 @@ * the first and last frames. */ lower_bound = first_frame_offset; + lower_bound_sample = 0; /* calc the upper_bound, beyond w...
2006 Oct 28
3
better seeking
...; - int i, lower_seek_point = -1, upper_seek_point = -1; + int i; unsigned approx_bytes_per_frame; - FLAC__uint64 last_frame_sample = FLAC__U64L(0xffffffffffffffff); + FLAC__uint64 last_frame_sample = FLAC__U64L(0xffffffffffffffff), this_frame_sample; FLAC__bool needs_seek; const FLAC__uint64 total_samples = FLAC__stream_decoder_get_total_samples(decoder); const unsigned min_blocksize = decoder->private_->stream_info.data.stream_info.min_blocksize; const unsigned max_blocksize = decoder->private_->stream_info.data.stream_info.max_blocksize; const unsigned max_framesize = decoder-&g...
2006 Nov 03
2
better seeking
...r_bound, lower_bound_sample, upper_bound_sample, this_frame_sample; + FLAC__int64 pos = -1; + int i; unsigned approx_bytes_per_frame; - FLAC__uint64 last_frame_sample = FLAC__U64L(0xffffffffffffffff); - FLAC__bool needs_seek; + FLAC__bool needs_seek = true, first_seek = true; const FLAC__uint64 total_samples = FLAC__stream_decoder_get_total_samples(decoder); const unsigned min_blocksize = decoder->private_->stream_info.data.stream_info.min_blocksize; const unsigned max_blocksize = decoder->private_->stream_info.data.stream_info.max_blocksize; const unsigned max_framesize = decoder-&g...
2004 Sep 10
0
better seeking
And here is another one. It allows fast seeking in streams without total_samples information. There is a check for such streams in flac, so flac --skip doesn't work. If the check is removed, it will work with --force-raw-format only, there is an issue with wav and aiff header handling. -- Miroslav Lichvar -------------- next part -------------- --- src/libFLAC/seekable_...
2024 Oct 16
1
C API: How to get a seektable for very long files?
Am 16.10.24 um 15:15 schrieb Martijn van Beurden: > > But how should such a number be presented to the libFLAC user? You > suggested overwriting the streaminfo total_samples number, but > streaminfo always precedes the seektable, so the streaminfo metadata > block is already parsed by the application before the seektable is > even read. Also, I think it is quite hacky to not pass the actual > streaminfo metadata block to the application but 'patch'...
2014 Aug 14
6
Encoder example for 24-bit files
...else that you can notice where I'm complete lost, I'll appreciate your help. Here's the diff: Index: main.c =================================================================== --- main.c (revision 1) +++ main.c (working copy) @@ -39,7 +39,7 @@ #define READSIZE 1024 static unsigned total_samples = 0; /* can use a 32-bit number due to WAVE size limitations */ -static FLAC__byte buffer[READSIZE/*samples*/ * 2/*bytes_per_sample*/ * 2/*channels*/]; /* we read the WAVE data into here */ +static FLAC__byte buffer[READSIZE/*samples*/ * 3/*bytes_per_sample*/ * 2/*channels*/]; /* we read the WAVE...
2005 Oct 03
3
Flac and OggFlac
...decode_position Why is that? 2) I have registered a metadata callback function with OggFLAC__seekable_stream_decoder_set_metadata_callback and I'm looking at the metadata struct being passed back. When using regular FLAC the field: metadata->data.stream_info.total_samples is set correctly, but with OggFLAC it seems to always be zero. Why? Can anyone shed any light? Cheers, Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo +-----------------------------------------------------------+ " Baldie is such a wo...
2014 Sep 26
4
Patch to add buffering to decoding too
...tfilename); static int DecoderSession_finish_ok(DecoderSession *d); static int DecoderSession_finish_error(DecoderSession *d); static FLAC__bool canonicalize_until_specification(utils__SkipUntilSpecification *spec, const char *inbasefilename, unsigned sample_rate, FLAC__uint64 skip, FLAC__uint64 total_samples_in_input); @@ -177,7 +177,7 @@ int flac__decode_file(const char *infilename, const char *outfilename, FLAC__boo if(!DecoderSession_init_decoder(&decoder_session, infilename)) return DecoderSession_finish_error(&decoder_session); - if(!DecoderSession_process(&decoder_session)) +...
2004 Sep 10
1
problem with seek_absolute in libFLAC++
Nevermind, I have discovered the problem(not really a problem). I had called: set_metadata_ignore_all(); because I didnt actually need to use the metadata in my application. But it seems that with this option set, "total_samples" is not set correctly after calling init(). Upon further debugging, I discovered that the test "sample < total_samples" was what is failing in the seek routine. By removing the call to set_metadata_ignore_all() the problem has disapeared. Sorry this is a rushed explanation,...
2024 Oct 16
1
C API: How to get a seektable for very long files?
...g to the last frame, there > should be two placeholders: > First has the offset set to ASCII "TOTALSMP", the next one all zeros. > That some encoder adds placeholder seekpoints with that pattern just by > chance is almost 0. > > When the decoder scans the seekpoints, the total_samples is 0 and if it > detects that two placeholders it will set total_samples to that value. > > I don't see an issue with that? Old files are treated by new decoder > just like before, new files are treated by old decoder also just like > before, only new file and new decoder will r...
2010 Mar 22
2
a "simple" statistic question
Hi, Please suggest a method to answer below questions: Factory_ID Factory_Location Factory_Size Total_Sample Good_Sample Fair_Sample Bad_Sample ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 1 City_A Big 100...
2008 May 19
1
Memory leaks due to Metadata object vorbis comment API ???
...ncAUDIO.flac"}; > > static void progress_callback(const FLAC__StreamEncoder *encoder, > FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned > frames_written, unsigned total_frames_estimate, void *client_data); > > #define READSIZE 1024 > > static unsigned total_samples = 0; /* can use a 32-bit number due to WAVE > size limitations */ > static FLAC__byte buffer[READSIZE/*samples*/ * 2/*bytes_per_sample*/ * > 2/*channels*/]; /* we read the WAVE data into here */ > static FLAC__int32 pcm[READSIZE/*samples*/ * 2/*channels*/]; > > int main(int argc,...
2006 Aug 06
2
Speex + Ogg package
...greatly appreciated. Into the encoder I have this code: speex_bits_reset(&enc_bits); for(int i=0;i<FRAMES_PACKET;i++) { int nb_samples; //Here I get the microphone data. while((nb_samples=Check_Mic(Mic_data))==0); speex_encode_int(enc_state, Mic_data, &enc_bits); total_samples += nb_samples; speex_bits_insert_terminator(&enc_bits); //The time stamp if(i==0) ((int*)packet)[0]=total_samples; } int nbBytes = speex_bits_write(&enc_bits, packet+4, 2000); tam=nbBytes+4; //Now the ogg package op.packet = (unsigned char *)packet; op.bytes = nbBytes...
2004 Sep 10
5
[st.n@gmx.net: Bug#200435: xmms-flac: doesn't properly support long files]
severity 200435 normal thanks I received this bug report from a Debian user. I can't think of any reason offhand why the command line tool would work while the xmms plugin would fail. ----- Forwarded message from Stephan Niemz <st.n@gmx.net> ----- Date: Tue, 8 Jul 2003 10:24:57 +0200 From: Stephan Niemz <st.n@gmx.net> Resent-From: Stephan Niemz <st.n@gmx.net> To: Debian
2004 Sep 10
4
bitbuffer optimizations
Ok, here is a patch waiting for new CVS :). It works fine for me, but please check it before commiting... -- Miroslav Lichvar -------------- next part -------------- --- src/libFLAC/bitbuffer.c.orig 2003-01-30 17:36:01.000000000 +0100 +++ src/libFLAC/bitbuffer.c 2003-01-30 21:53:18.000000000 +0100 @@ -51,6 +51,25 @@ */ static const unsigned FLAC__BITBUFFER_DEFAULT_CAPACITY = ((65536 - 64) *
2004 Sep 10
2
xmms plugin, fileinfo
...filename, &streaminfo)) { - return FALSE; - } - - tmp_file_info->sample_rate = streaminfo.data.stream_info.sample_rate; - tmp_file_info->channels = streaminfo.data.stream_info.channels; - tmp_file_info->bits_per_sample = streaminfo.data.stream_info.bits_per_sample; - tmp_file_info->total_samples = streaminfo.data.stream_info.total_samples; - - tmp_file_info->length_in_msec = streaminfo.data.stream_info.total_samples * 10 / (streaminfo.data.stream_info.sample_rate / 100); - - return TRUE; -} +#include "FLAC/metadata.h" +#include "charset.h" +#include "configure....