EC200U QuecOpen Audio example

In ql_audio_demo example of EC200U QuecOpen SDK, i do not understand about file name (full path required) argument of ql_aud_play_file_start function. Pls explain me about full path of file name argument as image

I think you can refer to the demo in the SDK. This interface is called for audio playback in many formats in the demo. The file path is defined in the header file of the demo. The path of the demo is as follows: components\ql-application\audio \audio_demo.c, the path of the header file is as follows: components\ql-application\audio\inc\audio_demo.h

image

1 Like

ok thank you, i understand. I only wish to know where i can find test_mp3.mp3/test_wav.wav…? Is it already on EC200 module or i must be make it ?

i want to know where is “UFS:test_mp3.mp3” ? thanks you

@thanhtinbk I think what you are talking about is how to import audio files into the module. There is no audio file in the module file system. You need to generate the file into the firmware when compiling and then flash it to the module.




Then compile and create firmware

2 Likes

thanks a lot vic.xie, you are exellent. I can add .mp3 file and can burn it to my FW. But, the result is play failed as image


I have tried both “file”: “/user/firm” and "file": “UFS:test_mp3.mp3” but the same result. Pls tell me what is the correct path of mp3 file ? Thanks

hello there
You can modify the “/user/firm” as “user/test_mp3.mp3”, file name should be your customized name, thank you.

1 Like

Hi Duncan.Xu, if i use “user/test_mp3.mp3” as my file path, how about “UFS:test_mp3.mp3” in my code ? Do i have to change it ? image
How can i view EC200U file system ?

hello there
The picture in the picture is just a reference example, you can choose to fill in the file name in the corresponding directory, if you don’t have other types of files, you can comment out or delete the useless code
image
The file system API header file is ql_fs.h, located in the components\ql-kernel\inc directory of the SDK package.

1 Like

I added "file": "user/test_wav.wav", "local_file": "test_wav.wav" in the ql_prepack.json file, and I added the file path as #define TEST_WAV_FILE_NAME "user/test_wav.wav" in the audio_demo.h file. However, the log still shows ‘ql_audio:test_wav 802 play failed.’ Can you help me find a solution?"

This is my ql_prepack.json file and audio_demo.h file.
audio_demo.h_image

ql_prepack.json_image

Any lead or solution please?

Hi @moser @_ZACKER,
If you’re still having trouble playing audio files. First you would need to make sure the file is actually there. Something like ql_file_exist() will do the job. Also, you may want to check the return value of the audio play function and see what’s the error.

Hi Victor.W . Can you please suggest what is wrong if I put an test_wav.wav file in sd card and not use prepack json stuff . and i define
image
I tried both of these and still get error audio play failed:
Case A:
#define TEST_WAV_FILE_NAME “UFS:LowBat_wav.wav”
Case B:
#define TEST_WAV_FILE_NAME “SD:LowBat_wav.wav”

Hi @Saurabh_Srivastava ,
Have you mounted the SD card before reading files in them?

Yes . Please note the code snippet below:
This mounts the sdcard right? fsMountSdcard()

@Saurabh_Srivastava
You may need to mount the SD card at application level.
See sdmmc demo for reference.