Displaying 19 results from an estimated 19 matches for "flac__streamdecoderwritestatus".
2011 May 24
3
Can a libFLAC encoder be initialize and called from inside a libFLAC decoder callback?
...();".
Samples are submitted to the encoder on line with "FLAC__bool OK =
FLAC__stream_encoder_process(m_Encoder, Buffer, Blocksize);".
I have a version that decodes to a WAV file and then re-encodes the WAV
file, but would like to avoid all that I/O.
Regards.
David
FLAC__StreamDecoderWriteStatus FLACRecoder::StaticWriteCallback(const
FLAC__StreamDecoder *FLACStreamDecoder, const FLAC__Frame *Frame, const
FLAC__int32 *const Buffer[], void *ClientData)
{
return ((FLACRecoder
*)(ClientData))->ClassWriteCallback(FLACStreamDecoder, Frame, Buffer);
}
FLAC__StreamDecoderWriteStatus F...
2016 Jan 19
0
FLAC__stream_decoder_seek_absolute calling write callback
...unk of code demonstrating
> the problem.
Thanks for your response!
Here's an example:
#include <iostream>
#include <FLAC++/all.h>
int main(int argc, const char * argv[]) {
class Decoder : public FLAC::Decoder::File {
protected:
virtual ::FLAC__StreamDecoderWriteStatus
write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const
buffer[]) override {
std::cout << "write_callback called!" << std::endl;
abort();
return
FLAC__StreamDecoderWriteStatus::FLAC__STREAM_DECODER_WRITE_STATUS_CONTI...
2014 Mar 08
2
16 bits FLAC file data to 32 bit float buffer for CPU processing
...f sine wave, instead of decoded FLAC file data, and it also works without problems; now I try different approaches to convert FLAC 16 bits sound data to 32 bits float CPU buffer, but they give noise or sound with artefacts. I use Stream Decoder from FLAC C API and my write_callback is as follows :
FLAC__StreamDecoderWriteStatus write_callback ( const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void * client_data ) {
size_t i;
BYTE * ChannelDataBuffer;
WORD * WORDChannelDataBuf...
2004 Sep 10
2
Storing FLAC in Matroska
...eadStatus flac_DecoderReadCallback(const
FLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void
*client_data)
{
flacData *ourData = (flacData *)client_data;
*bytes = fread((void *)buffer, 1, *bytes, ourData->inputFile);
return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
};
FLAC__StreamDecoderWriteStatus flac_DecoderWriteCallback(const
FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32
*const buffer[], void *client_data)
{
flacData *ourData = (flacData *)client_data;
for(int current_sample = 0; current_sample < frame->header.blocksize;
current_sample++)
{
for(int...
2013 Feb 09
2
Newbie question about those callbacks
For instance the write_callback thing:
client_data ? can it be a pointer to just about anything? For instance
a pointer to a two-dimensional array?
Are those FLAC-WAV and WAV-FLAC examples the only examples available?
What would be the best approach to read a FLAC file to an array of
some kind? Passing a pointer to the array as ?client_data?? I'd like
to use a two-dimensional array, but
2004 Sep 10
2
FLAC++ SeekableStream write_callback not being called?
...decode the audio data. It seems
to me as though the write_callback is never actually being called.
Before I pepper my code with a bazillion trace statements, can anyone tell me
if there is some obvious "trick-for-new-players" which I might have missed?
My write_callback looks like:
::FLAC__StreamDecoderWriteStatus
K3bFLACDecoder::Private::write_callback(const ::FLAC__Frame *frame, const
FLAC__int32 * const buffer[]) {
int i;
// Note that in canDecode we made sure that the input is only 16 bit stereo.
int samples = frame->header.blocksize;
internalBuffer = new QBuffer();
internalBuffer->ope...
2005 Sep 30
2
Reg. FLAC decoding
I'm using seekable_stream_decoder, And., this is my write_callback. I'm
not getting the required output. The PCM i get is not the proper music.
Am I doing something wrong here?
FLAC__StreamDecoderWriteStatus
AFLACStreamPlayer::StreamWriteCb (
const FLAC__SeekableStreamDecoder *decoder,
const FLAC__Frame *frame,
const FLAC__int32 * const buffer[],
void *client_data)
{
int Channels, BitsPerSample, BytesPerSample;
RMstatus ret;
AFLACStreamPlayer *pThis = (AFLACStreamPlayer *)client_data;
pTh...
2004 Sep 10
0
FLAC++ SeekableStream write_callback not being called?
...ugh the write_callback is never actually being called.
>
> Before I pepper my code with a bazillion trace statements, can anyone
> tell me
> if there is some obvious "trick-for-new-players" which I might have
> missed?
>
> My write_callback looks like:
>
> ::FLAC__StreamDecoderWriteStatus
> K3bFLACDecoder::Private::write_callback(const ::FLAC__Frame *frame,
> const
> FLAC__int32 * const buffer[]) {
> int i;
> // Note that in canDecode we made sure that the input is only 16
> bit stereo.
> int samples = frame->header.blocksize;
>
> internalBuf...
2013 Feb 10
0
Newbie question about those callbacks
Johnny Rosenberg wrote:
> For instance the write_callback thing:
> client_data ? can it be a pointer to just about anything?
I assume you mean:
https://www.xiph.org/flac/api/group__flac__stream__decoder.html#ga13
which defines the type:
typedef FLAC__StreamDecoderWriteStatus
(* FLAC__StreamDecoderWriteCallback)
(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame
, const FLAC__int32 *const buffer[], void *client_data)
Yes, client_data can point at anything. You the callee are responsible
to cast your pointer_to_...
2005 Sep 30
0
Re: Reg. FLAC decoding
...estions.
Josh
--- Joe Steeve <joesteeve@zodiactorp.com> wrote:
>
> I'm using seekable_stream_decoder, And., this is my write_callback.
> I'm
> not getting the required output. The PCM i get is not the proper
> music.
> Am I doing something wrong here?
>
> FLAC__StreamDecoderWriteStatus
> AFLACStreamPlayer::StreamWriteCb (
> const FLAC__SeekableStreamDecoder *decoder,
> const FLAC__Frame *frame,
> const FLAC__int32 * const buffer[],
> void *client_data)
> {
> int Channels, BitsPerSample, BytesPerSample;
> RMstatus ret;
>
> AFLACStreamPlaye...
2014 Mar 08
0
16 bits FLAC file data to 32 bit float buffer for CPU processing
...e the audio you can just remove the division.
You're obviously on Windows but on Mac OS X this can be done efficiently
using the Accelerate framework's vDSP_vflt16() and vDSP_vsdiv(). I'm sure
there are comparable routines you could use if the above method is too slow.
Stephen
> FLAC__StreamDecoderWriteStatus write_callback ( const FLAC__StreamDecoder
> *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[],
> void * client_data ) {
> size_t i;
>
> BYTE * ChannelDataBuffer;
> WORD *...
2004 Sep 10
0
http streaming in the xmms plugin
...,46 ****
--- 44,50 ----
#include "configure.h"
#include "wrap_id3.h"
#include "charset.h"
+ #include "http.h"
#ifdef min
#undef min
***************
*** 68,73 ****
--- 72,106 ----
DitherContext dither_context;
} file_info_struct;
+ typedef FLAC__StreamDecoderWriteStatus (*WriteCallback) (const void *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
+ typedef void (*MetadataCallback) (const void *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
+ typedef void (*ErrorCallback) (const void *decoder, FLAC__Str...
2004 Sep 10
2
Storing FLAC in Matroska
Hello,
I'm looking into storing FLAC audio in Matroska and I have a few
questions.
1. Can I use libflac to extract the compressed frames?
Or will I need to write up a simple file parser?
2. What is required to decode the frames?
From the docs I understand that you need the FRAME and you may need the
METADATA_BLOCK.
Thanks,
Jory Stone
jcsston@toughguy.net
Matroska, the new,
2013 Jul 01
2
About Decode Streaming
Sorry, I am newbie.
Sample codes are from
https://github.com/oneman/libflac/tree/master/examples/cpp.
I used FLAC__stream_decoder_process_single function but it still gives
exception. Maybe I could not control read callback, you're right.
I will check it and write result in this thread.
Thanks for help.
2013/7/1 Martijn van Beurden <mvanb1 at gmail.com>
> I'll top-post this
2004 Sep 10
2
flac_read callback not called in Windows?
...Decoder *decoder,
FLAC__uint64 *stream_length, void *client_data)
{
*stream_length = mame_fsize(flacFile);
return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK;
}
static FLAC__bool flac_eof(const FLAC__SeekableStreamDecoder *decoder, void
*client_data)
{
return(osd_feof(flacFile));
}
static FLAC__StreamDecoderWriteStatus flac_write(const
FLAC__SeekableStreamDecoder *decoder,
const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void
*client_data)
{
decode_flac_frame = frame;
decoded_flac_channel = buffer[0];
decoded_samples = frame->header.blocksize;
decode_buffer_pos = 0;
fprintf(stderr, "f...
2013 Jul 02
0
About Decode Streaming
...orCallback,
input_pile_array);*
*
*
Then, callbacks
*
*
/// \brief read callback function of decoder
FLAC__StreamDecoderReadStatus decoderReadCallback(const FLAC__StreamDecoder
*decoder,
FLAC__byte buffer[],
size_t *bytes,
void *callback_param
);
/// \brief write callback function of decoder
FLAC__StreamDecoderWriteStatus decoderWriteCallback(const
FLAC__StreamDecoder *decoder,
const FLAC__Frame *frame,
const FLAC__int32 * const buffer[],
void *callback_param
);
/// \brief error callback function of decoder
void decoderErrorCallback(const FLAC__StreamDecoder *decoder,
FLAC__StreamDecoderErrorStatus status,
voi...
2013 Jul 02
2
About Decode Streaming
...> *
> /// \brief read callback function of decoder
> FLAC__StreamDecoderReadStatus decoderReadCallback(const
> FLAC__StreamDecoder *decoder,
> FLAC__byte buffer[],
> size_t *bytes,
> void *callback_param
> );
>
> /// \brief write callback function of decoder
> FLAC__StreamDecoderWriteStatus decoderWriteCallback(const
> FLAC__StreamDecoder *decoder,
> const FLAC__Frame *frame,
> const FLAC__int32 * const buffer[],
> void *callback_param
> );
>
> /// \brief error callback function of decoder
> void decoderErrorCallback(const FLAC__StreamDecoder *decoder,
>...
2006 May 11
2
C++ Set_Metadata Problem
I refer to a problem that appeared on the flac list last August that was
either solved off-list or abandoned.
(http://lists.xiph.org/pipermail/flac/2005-August/000468.html)
The problem is with using the C++ encoder classes, particularly the
FLAC::Encoder::File:set_metadata
function. JC said that the developers version of how to add a simple
metadata block looked right, but it did not work for
2005 May 25
0
[PATCH] Fix fuction prototypes/definitions with void argument
...;
-static int FLAC_XMMS__get_time();
-static void FLAC_XMMS__cleanup();
+static int FLAC_XMMS__get_time(void);
+static void FLAC_XMMS__cleanup(void);
static void FLAC_XMMS__get_song_info(char *filename, char **title, int *length);
static void *play_loop_(void *arg);
@@ -128,7 +128,7 @@ static FLAC__StreamDecoderWriteStatus wr
static void metadata_callback_(const void *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
static void error_callback_(const void *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
-static void init_decoder_func_tables();
+static void init_decoder_func_ta...