"PlayAudioClip()" Is this a function in C?

Thread Starter

richard3194

Joined Oct 18, 2011
193
I've actually got various code for other people's WAV player projects. And was going thru them. And when I cannnot recognise what a line is doing, look at my books to see what is said of the code.

As to this function topic, I've not read much on it, but when I read "The only function built into c is sizeof().." it made me think that unless I included a library containing functions such as <stdio.h> ready-made functions are not available. So, I'm think I'm going to find something like printf() in stdio.h and lo and behold, it's not there. I'm obviously not understanding something.

Basically, I don't know how I have access to printf(). I mean, if stdio.h does not contain that function, and it includes functions for input and output, what library will.
 
Last edited:

MrSoftware

Joined Oct 29, 2013
2,273
The declaration for printf should be in stdio.h, keep looking.

Side note; this is where a good IDE can make your life easier. Right click on any call to printf and choose "go to declaration" and it will jump right to where it's declared in the header. If you're on the command line, find stdio.h then "grep -n -H printf ./stdio.h" and that will tell you exactly what line it's on.
 

Thread Starter

richard3194

Joined Oct 18, 2011
193
OK, so what I've learned is that PlayAudioClip() is a ready-made function in the UNITY game development system. But other than that, it's going to be a user-defined function. So, what I am doing is trying to cull from other peoples WAV player projects a suitable function for PlayAudioClip(), or whatever I wish to name the function that will achieve the task of playing a WAV file.

I have two basic options at producing audio, PWM or using a DAC.

I don't know what MCU I'll use. And I have a task of figuring out how to use buttons to play say up to 10 WAV files. I may make these issues a subject of other posts. Possibly in the Projects Forum. Thanks for the help given. Rich

EDIT: Of cource, I may just end up copying (more-or-less) someone elses code etc. etc. But I envisage there will be a need to modify.
 
Last edited:
Top