Post Go back to editing

Wav Player File (sources)

Category: Software
Product Number: ADAU1467
Software Version: Sigma Studio 4.7

Hi all,

I hope everyone had a pleasant Christmas.

My question is about this wav player: wiki.analog.com/.../wavplayer

I am looking for some guidance using the Wav Player with an ADAU1467 evaluation board.

The configuration of the sound sample file keeps me puzzling.

I have installed Audacity to extract a piece from the original file but I can't get it to work.

The file gets accepted but the sound output is not conform the sample.

Can someone tell me what settings to use to save a file?

Regards,

Martijn

  • ADI North America will be on winter shutdown starting December 25, 2023; perhaps another community member can assist you until our return on January 8, 2024.
  • Hello Martjin,

    Here is how I extracted a file from Audacity and used in the wav player module.

    The example shown above is for 8KHz, the file from audacity and Sigma studio software Fs are set for 8KHz. If you core and codec is at 48KHz you may hear a different frequency at the output this is because of the sample rate mismatches.

    Please note that, you can't use a larger file with this module. Because it uses the internal RAM for storing the samples hence it is very limited. For ex, a 2 second audio file at 48KHz will be around 200KB. so, it often throws out of memory error. If you really wanted to use a larger file, then use an external SPI based wav player which resides under master control port.

    If you have further questions, please attach your project and describe your issue in a detailed way.

    Regards,

    Harish 

  • Hi Harish,

    Thank you for your answer!

    It seems I have an different version of audacity, I run 3.4.2. This seems to be the most recent version.

    I'm sorry the system language is not in english but the menu structure should be the same.

    My export options are different.

    The file size is small as 0.1 second is enough for testing purposes.

    I think I tried all options from this menu but can't get it to work. Do you have any suggestions?

             

    Edit: using a older version of audacity I was able to get the sample and store it in the adau1467.

    As seems is the problem the wav player itself, clipping the audio at every restart, sounding like a machine gun.

    I used exactly your settings and setup.

  • Hello,

    This is the setting for the latest version of audacity.

    My file is around 79KB, and it works well.

    Try that loopback setting for a continuous play. You don't need to restart every time. As I said, this wav player is not often used. It has a few limitations like memory, external trigger not being there.

    The external SPI memory-based trigger wav player is quite often used. You can find the link here.

    Regards,

    Harish

  • Hi Harish,

    Thank you for your support.

    I try to repeat your steps and show my results here.

    This is the audio file that's used in Sigma Studio

    And this is how it sounds on repeat.

    The output is connected to a max98306 amp at 9 gain(dB)

    This should be a soft white noise and not like this.

    Has anyone a suggestion what's going wrong? That would be very much appreciated!

    Regards,

    Martijn

  • Hello Martijn,

    As I mentioned in my first reply, your core, software, DAC and all must be running at the same rate.

    I see you extracted the file for 8HKz rate, so rest of your system run at the same 8KHz sample rate?

    If there are mismatches in the sample rates, then you can't expect the same audio at the output?

    So, make sure that everything is running at the same rate, and we will move forward with your reply.

    Regards,

    Harish

  • Hi Harrish,

    Thank you for your fast reply!

    I assume you mean this?

    If not, please tell what settings to change.

    Best regards,

    Martijn

  • Hello Martijn,

    That's the software sample rate, this setting in SigmaStudio is ONLY used by the compiler so it can properly calculate anything that requires a knowledge of time like filters, compressor time constants, timers and oscillators etc.

    The DSP core rate will be configured by the start pulse register. You have various options to set this start pulse from. It can be from internal clock generator, external serial port clocks, SPDIF Rx rate etc.

    By default, the start pulse register is set for Clock generator 1's x1 output. Clock generator 1's output is 48KHz because of the N/M ratio. Here it is set for N/M=1/6, hence the rate is 48KHz. (please refer the clocking page in the datasheet for more info). please refer the below picture for the default setting.

    Here we set CG1's x1 output which is same as the CG1's output which is 48KHz. So, now your core is running at 48KHz.

    By default, serial input and output port is also running from CG1's output and sample rate set as Fs (Base_fs) which is 48KHz.

    In a fresh sigma studio project, your entire hardware sub systems and software sample rate is set for 48kHz as default.

    ADC and DAC should also be running at the same rate for a proper processing. If any one of them is out of sync, then you wouldn't get the output as expected. Please refer this post to know more about the sigmaDSP sample rate sub systems.

    In your case, since you didn't attach your project, I'm not sure about the hardware settings. If you are using the eval board then you need to program the codec to run at different rates using I2C. The codec is at standalone mode (48KHz) by default. Codec programming by I2C is needed to run the codec at different rates.

    Note that, the CLKOUT pin of the DSP is giving the MCLK to the Codec which is 12.288MHz. With this you can only achieve 48KHz,96KHz,192KHz by changing the divider.

     With the existing MCLK, it can easily run at 96KHz,192KHz by programming the codec. However, running the codec at 8KHz will take a lot of modification work. The MCLK going into codec part must be changed and PLL should be disabled, and it should be run at direct master clocking. It's not quite easy and if it's eval board then it may need re-soldering.

    If you are using the eval board without modification or without programming the codec to the desired rate, then you will not get the proper output because of the sample rate mismatches.

    I will attach few posts which explains how to run the codec at 8KHz. please refer to it. You can also search the forum for more answers.

    1)  AD1937 - does it support 8kHz - Q&A - Audio - EngineerZone (analog.com)

    2)    RE: AD1939 at 8Khz sample rate

    Regards,

    Harish

  • Thank you Harrish for reply.

    As everything default is 48khz, lets stick to the 48khz.

    The only reason to switch to 8khz was because the image you shared in the second reply.

    I exported a sample at 48khz from Audacity, imported this in Sigma Studio.

    Although I exported the sample as signed 16bit pcm, the wav player works with the settings at 8bit. Possibly something to do with the signed part?

    Thank you for your time and help!

    The project file is attached.

    audiotest.dspproj

  • Hello Martmarttoo,

    I have used your project and I exported two files from audacity with different bit levels. One is signed 16bits and the other is signed 32bits. I chose the respective bit setting in sigma studio window. Both files work good with your project. I got a decent audio output and a waveform for the correct frequency given which is 100Hz. My sample rate is 48KHz.

     Please find the attached wav file below. Please try it in your side and get back.

    Regards,

    Harish

Before You Switch


Switching languages will make ADI Explorer unavailable. Resume your session by switching back to English and reopening ADI Explorer.