|
From: Chris B. <ch...@cn...> - 2010-05-25 19:20:18
|
As mentioned in other reply, you won't be able to use those functions under
MSVC++.
Your next best bet is to try and get example1.c working. Were it calls
sox_read() and sox_write(), you could replace that with your own code to
read and write from memory.
Chris
On Tue, May 25, 2010 at 12:50 AM, WBX <gui...@gm...> wrote:
>
> Hi all,
>
> I'm really newbie with sox and I having some problems.
>
> I've been able to compile libsox with mp3 options and now I would like to
> write a simple Windows XP x86 library. The goal is receiving CVSD bytes
> (64KHz sampling rate, 16 bits/word) decode them to WAV format and then pass
> resulting bytes to mpg123.lib in order to play the audio.
>
> As start point I focused myself on example5.c from source code but I'm
> getting error bellow when using sox_mem operations (any of them):
>
> formats: can't open output file `': Invalid argument
>
> Here is draft code:
>
> static char buffer[buffer_size];
> static sox_format_t * in; // Input file
> static sox_format_t * out; // Input file
> sox_sample_t samples[MAX_SAMPLES]; // Temporary store whilst copying
> size_t number_read;
>
> mpg123_handle *m;
>
> // All libSoX applications must start by initialising the SoX
> library
> if (sox_init() != SOX_SUCCESS) {
> fprintf(stderr,"Unable to initialize sox library\n");
> return -1;
> }
>
> // Open the input file (with default parameters)
> in = sox_open_read(argv[1], NULL, NULL, NULL);
> if (in == NULL)
> {
> fprintf(stdout,"Unable to open read\n");
> return -1;
> }
>
> // _____________ ERROR _____________
> out = sox_open_mem_write(&buffer, buffer_size, &in->signal, NULL,
> ".sox",
> NULL);
> // _________________________________
> if (out == NULL)
> {
> fprintf(stdout,"Unable to open write\n");
> return -1;
> }
>
> Any idea would be really appreciated.
>
> Thanks in advance.
>
> Willy
> --
> View this message in context:
> http://old.nabble.com/Relay-with-libsox-tp28664538p28664538.html
> Sent from the SoX mailing list archive at Nabble.com.
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Sox-users mailing list
> Sox...@li...
> https://lists.sourceforge.net/lists/listinfo/sox-users
>
|