cancel
Showing results for 
Search instead for 
Did you mean: 

How to point engine_start2?

WMa.2
Associate II

This is the sample program I used.0693W00000aPNt3QAG.pngThis is sounddb.s .0693W00000aPNsyQAG.pngWhen I DEBUG a variable, I find that these pointers point to the same address.0693W00000aPNstQAG.pngI used two audio files. How do I have my program play the second audio file directly?I modified the userFunction as shown below.0693W00000aPNvOQAW.pngI set the breakpoint at the location shown below.

0693W00000aPNwMQAW.pngObserve the variables as shown in the figure below.

0693W00000aPNwgQAG.pngI already extern the Engine_start10693W00000aPNxUQAW.pngWhat is the reason for this?

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you for your answer. I found the problem and solved it yesterday. The problem was with my first audio file. It ends with software information for recording audio. I recorded it using Adobe Audition. Is there any recommended audio software? Thank you for your help.

View solution in original post

5 REPLIES 5
ATROI
ST Employee

Hi WMa,

In the initWaveFile function the last line calls the function "checkWavFile". 

This function, contained in the file sound.c., is in charge to fill the pointers to each WAV file   

0693W00000bhDYyQAM.pngI hope this helps.

WMa.2
Associate II

Thank you for your answer.I noticed this function. However, the values of sounddb[1].start and sounddb[0].start are the same during debugging. The correct sounddb[1].end value is not generated in this function.The whPtr parameter is still the first audio parameter.

The values for sounddb[1].start and sounddb[0].start are shown in the figure in my question.They're all 0x10000000.

ATROI
ST Employee

Hi WMa,

I’ll check the procedure described in the UM, anyway here it is a workaround:

Step 1: Create one sounddb.s for each wave file ( see the image below)

0693W00000bhOdpQAE.jpgStep 2: According to the compiler you are using, modify the file user_###.ld. adding the following code for each wave file you want load:

0693W00000bhObBQAU.jpg 

Step 3: In sound.c file, modify these functions: checkWavFile and initWaveFile as showed in the images below:

0693W00000bhOg5QAE.jpg0693W00000bhOf2QAE.jpg 

Step 4: In the main.c add one initWaveFile function for each wave files to play:

0693W00000bhOgPQAU.jpg 

Step 5: modify the userFunction according to your needs.

I hope this helps.

Thank you for your answer. I found the problem and solved it yesterday. The problem was with my first audio file. It ends with software information for recording audio. I recorded it using Adobe Audition. Is there any recommended audio software? Thank you for your help.