Sign in

username:

password:



Not a member?

Search speechcoding



Search tips

Subscribe to speechcoding



speechcoding by Keywords

ACELP | ADPCM | AMBE | AMR | AMR-NB | CELP | Codebook | DTMF | G.723 | G.726 | G.729 | GSM | Interpolation | LPC | LSF | LSP | MELP | PCM | Perceptual | Pitch | PSOL | QCELP | Quantization | SMV | VAD | Vocoder

Ads

Discussion Groups

Discussion Groups | Speech Coding | CELP using VC++

Technical discussions related to Speech Coding (all itu and other vocoders, ACELP, CELP, AMR, etc)

  

Post a new Thread

CELP using VC++ - yaso21101975 - Jan 8 9:40:03 2007



hi all
I am working on a project on audio compression using code excited
linear prediction (CELP) techniques. My aim is to design a basic
working CELP codec using visual c++ under windows.
i have some problem reading data chunk from riff format file using vc++ 
whene i try to read a block of 240 byte only 60 byte are read and the 
rest of buffer is zero i try different commandes (_read,fread...)it 
give me the same fault.
Can someone help me by refering some relavent documents explaing the
how to do this correctly or a sample program in vc++ I will be highly 
obliged.
thanks.
yaso



(You need to be a member of speechcoding -- send a blank email to speechcoding-subscribe@yahoogroups.com )

Re: CELP using VC++ - Jeff Brower - Jan 8 11:07:07 2007

Yaso-

> I am working on a project on audio compression using code excited
> linear prediction (CELP) techniques. My aim is to design a basic
> working CELP codec using visual c++ under windows.
> i have some problem reading data chunk from riff format file using vc++
> whene i try to read a block of 240 byte only 60 byte are read and the
> rest of buffer is zero i try different commandes (_read,fread...)it
> give me the same fault.
> Can someone help me by refering some relavent documents explaing the
> how to do this correctly or a sample program in vc++ I will be highly
> obliged.

I don't know if this helps or not, but here is some info on typical .wav file format:

  http://www.signalogic.com/index.pl?page=ms_waveform

Suggest to verify first that you can read the header (44 bytes) correctly in your C/C++
program.  Then you should be
able to read the next 240 bytes (which would be 120 samples for 16-bit format .wav file).

-Jeff



(You need to be a member of speechcoding -- send a blank email to speechcoding-subscribe@yahoogroups.com )

Re: CELP using VC++ - chen...@hotmail.com - Jan 9 7:54:36 2007

You can also try the following program. It worked well for me

        ...

	FILE *src;

        char  f_scr_name[50];

	short FileHead, FileTail;
	short In_buffer[120];         // 120 words or 240 bytes

        long  Flen;                   // File Length
        long  Frame_Number;           // Frame Number

        long  i;
        strcpy(f_scr_name,"yourprograme.wav");

        if((src=fopen(f_scr_name,"rb"))==NULL)
	{
           printf("can't open file !\n");
           exit(0);
	}
        fseek(src, 0L, SEEK_END ) ;
        Flen = ftell(src)-0x2c;
        Frame_Number = Flen / 240;       // Frame Numbers(240 bytes/frame)
        rewind(src) ;  	
        fread(&FileHead,1,0x2c,src);  	 // 44 bytes head

	for(i=0;i<Frame_Number;i++)              
	{
    	    fread(&In_buffer,2,120,src);		

            // your program here
            ...
        }
        
        ...
       
        fclose(src);

        ...
If you want the last frame which maybe less than 240 bytes, you can also add this kind of
program into the original program.
        for(;!feof(src);) 
	{
	    fread(&filetail,2,1,src);  
        }

- zhixin
hi all
>I am working on a project on audio compression using code excited
>linear prediction (CELP) techniques. My aim is to design a basic
>working CELP codec using visual c++ under windows.
>i have some problem reading data chunk from riff format file using vc++ 
>whene i try to read a block of 240 byte only 60 byte are read and the 
>rest of buffer is zero i try different commandes (_read,fread...)it 
>give me the same fault.
>Can someone help me by refering some relavent documents explaing the
>how to do this correctly or a sample program in vc++ I will be highly 
>obliged.
>thanks.
>yaso



(You need to be a member of speechcoding -- send a blank email to speechcoding-subscribe@yahoogroups.com )