This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to play .alaw format file under wince 6 + DVSDK and omap 35xx

Hi all,

 

Using g726 decoder i am generating a .alaw file for speech data .pcm encoded file.

 

I need to play this .alaw file/data under wince 6 omap 35xx device.

There is a function " Sound_write() under linux code in DMAI sample application.

 

I am not getting how to play it under wince omap35xx the same.

 

Can you suggest ?

Hoping for a reply and help from you.

Regards,

Misbah

  • Misbah,

    We've received your question and will do our best to have someone from the technical team respond as soon as possible.

  • Misbah,

    Refer this thread. It may give you some pointers on how to play a raw audio file.

    http://e2e.ti.com/support/embedded/f/353/p/58850/231270.aspx#231270

    Jatin

     

  • Hi Jatin,

    I Refered to the link provided by you and tested playing g726 decoded alaw,ulaw files but the wince application returns always error as

    "Invalid wave file header"

     

    Using g726 encoder i am encoding a .wave format speech raw file (alaw,ulaw and no compandingLaw)  and getting an output .pcm file.

    I am then decoding these files g726 decoder (alaw,ulaw and no compandingLaw) and getting output as three different companded files.

     

    Each time i try to play using wince application "wavplay.exe" (As suggested by you in the thread) It always fails with error as

    "Invalid wave file header"

     

    I even tried with the file provided by TI as an example for g711 encoder input "davincieffect.g711" as an input source file but the result remained same.

     

    Please suggest/help in this regard.

     

    Regards,

    Misbah

     

     

  • Hi All,

     

    Can any body reply to the last post.

     

    Its urgent for Us.

     

    Thanks ,

    Misbah

  • Misbah,

    As i mentioned in my earlier post the thread may give you some pointers on how to go about playing an audio file. The wave play expects wav file with wav header and will not play a.law file as is. But there maybe similar functions that may achieve what you are trying to do. My suggestion would be for you to post to MSDN forums or take a look at any audio renderer filter implementation that may be available to see how audio is handled or even CETK tests for audio and change that to suit your need. (Adding a wav header to the beginning of your sound buffer maybe helpful as well but I'm not sure).

    Jatin

  • Hi Jatin & All,

    Under my wince development setup with DVSDK i configured mp3 decoder & G726 codec. I used DMAI based sample application provided by TI to test G711 & G726 encoding of speech file (.wav format).

     

    The test application "speech_decode_io1 and speech_encode_io1" runs without fail and encode the file then decode it to generate the output file (.wav format) If i configure the codec as g711 encode the input speech (.wav format) file then decode it then i can play the output file directly under my wince device (omap35xx)

    But if i configure the codec as g726 and encode the same input speech file i get no error and it encodes then decodes it and generates an output .wav format file. i cannot play this output file as the data contained in the file is not proper and the player detects wrong header for .wav format output file.

     

    I assumed that the application is written to test g711 encoder/decoder so i wrote my own application with the input parameter configured for g726 compiled it and executed

    I get no error and it encodes and decodes the files and generates the output .wav file.

     

    But here again the player finds the header improper and throws error. I then just modified the 48 byte .wav header of the output file and then the player is able to play the file.

     

    If we encode the .wav file and decode it the header data should remain intact as in the case of TI's test application tested for g711

    The strange thing is that the data is proper, thats the reason it is being played properly by the audio player.

     

    Is it something to do with input parameters ?

     

    Please find my application for encoding and decoding of an input speech file using g726 codec.

     

    Please suggest/help me

    5635.G726_test.rar

     

    Regards,

    Misbah

     

  • HI All,

     

    Can any of you help me with my previous post ?

     

    Seriously require your attention.

     

    Regards,

    Misbah

  • Misbah,

    I don't completely understand what you are trying to do and why you have wav header when calling the codec encode/decode functions via dmai (maybe I misunderstood what you have written). The data fed to the TI encoder/decoder should not have any wav header. The wav header should only be added when you are ready to pass the decoded file (PCM samples buffer) to a WinCE playback function and even this is just a workaround.

    Jatin