pfeeee...

This commit is contained in:
tTh
2023-01-03 21:59:38 +01:00
parent b707b784bf
commit 3f95a964e5
9 changed files with 50 additions and 21 deletions

View File

@@ -24,7 +24,17 @@ return 0;
/* --------------------------------------------------------------- */
void print_version(char *msg)
{
fprintf(stderr, "=== %s compiled %s, %s\n", \
fprintf(stderr, "=== %s, support compiled %s, %s\n", \
msg, __DATE__, __TIME__);
}
/* --------------------------------------------------------------- */
int check_textfile_validity(char *filename, int what)
{
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( '%s' %d )\n", __func__, filename, what);
#endif
return -1;
}
/* --------------------------------------------------------------- */

View File

@@ -10,4 +10,6 @@ int display_sf_info(SF_INFO *psf, char *text);
void print_version(char *title);
int check_textfile_validity(char *filename, int what);
/* --------------------------------------------------------- */

View File

@@ -1,5 +1,5 @@
/*
* TEXT TO WAV
* TEXT TO WAV - a klugeware from tTh 2023
*/
#include <stdio.h>
@@ -27,7 +27,7 @@ int left, right;
int nb_lus, idx;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( '%s' )\n", __func__, outf);
fprintf(stderr, ">>> %s ( '%s' %d %d )\n", __func__, outf, sr, format);
#endif
if (format) {
@@ -78,11 +78,16 @@ while (2==fscanf(input, "%d %d", &left, &right)) {
sf_write_short(sndf, buffer, idx);
sf_close(sndf);
fprintf(stderr, "%s: %d buffers written\n", __func__, nb_lus);
free(buffer);
fprintf(stderr, "%s: %d samples written\n", __func__, nb_lus);
return 0;
}
/* --------------------------------------------------------------- */
/*
* this is a preview software, so no args parsiong yet...
*/
int main(int argc, char *argv[])
{
int foo;

View File

@@ -59,10 +59,7 @@ if ( NULL == (samples = malloc(BUFFER_SIZE*sizeof(short))) )
abort();
}
while ( (lu=sf_read_short(sndf, samples, BUFFER_SIZE)) > 0 )
{
// fprintf(stderr, " LU = %5u\n", lu);
while ( (lu=sf_read_short(sndf, samples, BUFFER_SIZE)) > 0 ) {
for (foo=0; foo<lu; foo+=2) {
printf("%d %d\n", samples[foo], samples[foo+1]);
}