Editing Audio Library

Status
Not open for further replies.

chandrian

Member
Hello,

So I was trying to make modifications to the Audio Library by making edits to the Audio-master folder I downloaded and I wasn't seeing the changes. So is the library included already with Teensyduino? and if so how do you compile/upload the code using the development library from Github? Sorry I am a noob and still trying to figure out how compiling works..

Thanks,
Aaron
 
download audio library and place it in library subdirectory in your Arduino sketch folder.
It will take precedence to the stock library.
So you can do what ever you wanted with your own library.
 
Thanks for the response! I had this same thought but was discouraged when I couldn't find a folder that the arduino IDE was referencing. I was also wondering if I could throw the whole Audio-master folder in there or just specific files that I want changed. I guess some testing could/can solve that. Another note,

I probably have to change the:

#include <file>

to:

#include "file"

so that it looks in the current directory. Anyway, I will do some testing and thank you for the response!

Aaron
 
I probably have to change the:

No, you're overthinking this and making it harder than it should be. There are plenty of reasons you might edit the code, but this isn't one of them. Arduino is designed so you can just put a copy in the right place to override the other ones.

If you're using Windows (we can't see your screen... can't even tell which type of computer you have), your "sketchbook folder" is "Arduino" within your Documents folder. If you're unsure, or using Mac or Linux, click File > Preferences. The first item in the prefs windows is "Sketchbook location". Go to that folder and look for a folder within it called "libraries". *THAT* is where you put the copy you downloaded from github.

Also, rename it from "Audio-master" to just "Audio".

Quit and restart Arduino, so it will rescan where all the libraries are located. Open any of the Audio library examples, from File > Examples > Audio. Now, to check, add any sort of error. Just type a random word anywhere in the code, so it will have an error when you compile. Then click Verify. When it fails to verify, Arduino should show you a message that it found 2 duplicate copies of the library. It will explain which one it used and which it ignored. If you put yours into the right location, it should override the other.

Remember you put it there! Or at least pay attention to that warning. This is one of the common problems people encounter. They do this to override some library. Then a year or two later they go to use the library again, completely forgetting they overrode it (and wish to use a new version). That is *why* Arduino shows you this message about the duplicates!
 
Status
Not open for further replies.
Back
Top